Mesh and Line Graph from CSV File

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Polygons 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by