Error is coming how can I solve?
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
Cell contents reference from a non-cell array object.
Error in Mineral_2 (line 12)
line([A(xmaxA) A(xmaxA)], [limh(1) max(A(:,2))], 'color', chrom{1},'Linestyle',':')
0 件のコメント
回答 (3 件)
Caroline
2013 年 8 月 23 日
0 投票
Could you post the code? It could be because you used {} instead of () to access the element of an array but its hard to say without seeing the code.
1 件のコメント
Image Analyst
2013 年 8 月 23 日
編集済み: Image Analyst
2013 年 8 月 23 日
Before that line, put these lines:
whos chrom
chrom{1}
Tell us what it says. Then look at this link: http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/
0 件のコメント
Walter Roberson
2013 年 8 月 23 日
0 投票
You make chrom a cell array. Somehow it is not one at the moment in your code.
5 件のコメント
RS
2013 年 8 月 23 日
Walter Roberson
2013 年 8 月 23 日
plot() of a single column will return the handle of a single lineseries object. You get() the color property of that one object, and what will be returned will be a string rather than a cell array of strings. So just pass chrom into line() rather than passing chrom{1} or chrom(1)
RS
2013 年 8 月 24 日
Image Analyst
2013 年 8 月 24 日
You need to have the same number of x values as y values, and you need, need, need to learn basic debugging skills. Is B an integer array, so that you might have multiple locations for xmaxA? What can you learn from doing this:
xValues = [A(xmaxA) A(xmaxA)]
size(xValues)
yValues = [limh(1) max(A(:,2))]
size(yValues)
Walter Roberson
2013 年 8 月 24 日
You still need the keyword 'color'
line([A(xmaxA) A(xmaxA)], [limh(1) max(A(:,2))], 'color', chrom,'Linestyle',':');
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!