stream3のエラーについて

お世話になっています。
初学者です。簡単な質問ですが、ご回答いただければ幸いです。
stream3を用いて解析したいと考えています。
[startX,startY,startZ] = meshgrid(0,0,0);
verts = stream3(x,y,z,u,v,w,startX,startY,startZ);
lineobj = streamline(verts);
view(3)
このコードで、原点からの三次元流線データが欲しいです。
しかし、
次を使用中のエラー: matlab.internal.math.interp1
サンプル点は一意でなければなりません。
エラー: interp1 (行 188)
VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol);
エラー: stream3 (行 67)
szi=interp1(zz(:),1:szu(3),sz(k));
のエラーが出てしまっています。
どの様にすれば、解決できますか??サンプル点決定の為のアドバイスをぜひ頂きたいです。

4 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 10 月 11 日
We can't run your code as you have not defined the variables x, y, z, u, v, and w. Please update your code.
巧 平山
巧 平山 2023 年 10 月 11 日
Hi Joshi
Thank you for your question. please check this code
Gz=(1:1:998);GGz=zeros(40,32); G2x=zeros(40,32,998);G2y=zeros(40,32,998);G2z=zeros(40,32,998);
[G1x,G1y]=meshgrid(1:32,1:40);
Gu=rand(40,32,998);Gv=rand(40,32,998);
for k=1:998
G2x(:,:,k)=G1x;G2y(:,:,k)=G1y;G2z(:,:,k)=GGz+1;
end
w=zeros(40,32,998);w=w+1;
[startX,startY,startZ] = meshgrid(0,0,0);
verts=stream3(G2x,G2y,G2z,Gu,Gv,w,startX,startY,startZ)
Error using matlab.internal.math.interp1
Sample points must be unique.

Error in interp1 (line 188)
VqLite = matlab.internal.math.interp1(X,V,method,method,Xqcol);

Error in stream3 (line 67)
szi=interp1(zz(:),1:szu(3),sz(k));
lineobj = streamline(verts);
view(3)
Would you check my code??
Atsushi Ueno
Atsushi Ueno 2023 年 10 月 11 日
多分最初の3項(G2x,G2y,G2z)が単調でない事がエラーの原因だと思います。
I think the error is probably due to the fact that the first three terms (G2x, G2y, G2z) are not monotonic.
巧 平山
巧 平山 2023 年 10 月 12 日
ご回答ありがとうございます。G2x,G2y,G2zを調節することで、エラーが出なくなりました。有難うございました

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

リリース

R2023a

タグ

質問済み:

2023 年 10 月 11 日

コメント済み:

2023 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!