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!

