필터 지우기
필터 지우기

assigning 32 values in an equation by for loop in matlab

조회 수: 1 (최근 30일)
Sat m
Sat m 2013년 3월 18일
i have generated 32 3D points and 32 2D points from a graph. now i wish to assign those points in an equation. i want the equation to be in format as
A = [X11*x11 Y11*y11 Z11;X22*x22 Y22*y22 Z22;.....]
like this
this is my code
for h=1:32
A = [Xhh*xhh Yhh*yhh Zhh];
disp(A);
end
now how can i write the program, so that my values in matrix A will come in a column instead of rows? i mean to say that it will come like this
[X11*x11 Y11*y11 Z11
X22*x22 Y22*y22 Z22
X33*x33 Y33*y33 Z33
....
...
...]
if i write like
A = [Xhh*xhh Yhh*yhh Zhh]
then it will all come in a row. please let me know how to solve this

채택된 답변

Walter Roberson
Walter Roberson 2013년 3월 18일

추가 답변 (1개)

Matt J
Matt J 2013년 3월 18일
편집: Matt J 2013년 3월 18일
One simple modification would be to load the data row-wise as you're doing now and then transpose
A=A.';

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by