Info
此问题已关闭。 请重新打开它进行编辑或回答。
How do I loop through a matrix using values from a vector
4 次查看(过去 30 天)
显示 更早的评论
This is what I have so far :
function [x, y] = make1DGrid(n,l) %L (lenght of domain) %Nel (Number of elements) x = linspace(0,l,n) y = vec2mat(x, 2) end
>> make1DGrid(11,10)
x =
0 1 2 3 4 5 6 7 8 9 10
y =
0 1
2 3
4 5
6 7
8 9
10 0
ans =
0 1 2 3 4 5 6 7 8 9 10
but my matrix needs to look like this :
y =
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!