Triplot Error

1 回表示 (過去 30 日間)
Jennifer
Jennifer 2011 年 10 月 26 日
回答済み: BhaTTa 2025 年 1 月 5 日
Hi
I wonder if anyone can help. I am trying to create a mesh to be used in a CFD program. However when I run my code I get the following error:
??? Index exceeds matrix dimensions.
Error in ==> triplot at 69
h = plot(x(d), y(d),c,varargin{start:end});
My code is as follows:
load nodes.txt
>> x=[nodes(:,1)];
>> y=[nodes(:,2)];
>> tri = delaunay(x,y);
>> triplot(tri,x,y);
nodes.txt <973x2 double>
x <973x1 double>
y <973x1 double>
tri <1818x3 double>
Any help you would be gratefully received
Thanks

回答 (1 件)

BhaTTa
BhaTTa 2025 年 1 月 5 日
Hey @Jennifer, Usually "Index exceeds matrix dimensions" error indicates that you're trying to access an element of a matrix or array using an index that is out of bounds. In the context of your code, it seems like there might be an issue with how the triplot function is being called or how the data is being handled.

カテゴリ

Help Center および File ExchangeOperators and Elementary Operations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by