error size regarding contour plot
显示 更早的评论
I wan to plot a contour by using this code:
fileName = 'Simulation.txt';
nPitch = 202;
nTSR = 250;
%% Read in text file
fileID = fopen(fileName);
raw = textscan(fileID, '%f%f%f%f%f%f%f%f%f%f', 'Headerlines', 7);
fclose(fileID);
pitch = raw{3};
TSR = raw{7};
Cp = raw{8};
Ct = raw{8};
%% Re-arrange data
pitch = pitch(1:nPitch); % use individual values only
TSR = TSR(1:nPitch:end); % use individual values only
Cp = reshape(Cp, nPitch, nTSR, 1); % transform vector into matrix
Ct = reshape(Ct, nPitch, nTSR, 1); % transform vector into matrix
disp(pitch)
It seems number of unique value of pitch and TSR is wrong and this error appears:
Error using reshape Number of elements must not change. Use [] as one of the size inputs to automatically calculate the appropriate size for that dimension. Error in pitch_tsr_cp (line 23) Cp = reshape(Cp, nPitch, nTSR, 1); % transform vector into matrix
as I checked file also in excel I have 250 uniqe TSR value amd 202 pitch uniqe value.
2 个评论
Mathieu NOE
2024-1-31
hello
it would help if you could share the data file as well
maybe you need to zip it if it's too big (limit = 5 Mb)
Hossein
2024-1-31
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

