non-uniform symmetric grid in 1D
31 ビュー (過去 30 日間)
古いコメントを表示
abolfazl mahmoodpoor
2022 年 11 月 2 日
コメント済み: abolfazl mahmoodpoor
2022 年 11 月 2 日
I am trying to make a non-uniform symmetric grid in 1D (dense grid close to the boundaries), is there any simple command?
0 件のコメント
採用された回答
Bruno Luong
2022 年 11 月 2 日
The chebychev nodes cross my mind
leftbnd=-10
rightbnd = 10;
n = 30
chebychevgrid=@(leftbnd,rightbnd,n)leftbnd+((rightbnd-leftbnd)/2)*(cos(linspace(pi,0,n))+1)
a = chebychevgrid(leftbnd,rightbnd,n)
plot(a, ones(size(a)),'-o')
その他の回答 (1 件)
Walter Roberson
2022 年 11 月 2 日
No, there is no simple command for it.
If you have the first half, say a row vector B, then you can build the rest as
[B, ENDVALUE-fliplr(B)]
except, that is, for the case where the last B value is exactly half-way through, in which case you do not want to duplicate that value...
You can create your own simple functions for this, but Mathworks does not provide any simple command for it.
参考
カテゴリ
Help Center および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!