フィルターのクリア

Mesh and Line Graph from CSV File

2 ビュー (過去 30 日間)
Maeve O'Brien
Maeve O'Brien 2020 年 2 月 11 日
回答済み: Charan Jadigam 2020 年 3 月 3 日
Hello!
I'm trying to create both a mesh and a line graph from a .csv file. However, I am running into two errors- an error with the "colon operands must be real scalars" and that the "character vector is not terminated properly". Any help to fix these two errors would be greatly appreciated.
tot=imread('SUM_Test59_Top_Reslice.tif');
x = (1:1988)*1.3;
y = (1:2160)*1.3;
L1=tot*1.3;
mesh(y,x,L1);
colormap;
caxis([]);
xlabel('length[um]');
ylabel('length[um]');
xlim([0 max(x)])
ylim([0 max(y)])
m1=sum(L1(1:2160,:,'));
plot(m1);

回答 (1 件)

Charan Jadigam
Charan Jadigam 2020 年 3 月 3 日
Hi,
I can see you are passing into ‘mesh’ data with different sizes, this would cause ‘Data dimensions must agree’ error.
The errors occur because of extra character in the m1=sum(L1(1:2160,:,')); statement. While calculating m1 using L1, the correct way of indexing would be,
m1=sum(L1(1:2160,:,:));

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by