how to save array in different dimension
이전 댓글 표시
Greetings!
I have a loop that calculates ri:
for i = 1:length(x)
ri(i)=sqrt(((x(i)-xs)*111.1)^2)+(((y(i)-ys)*85.3)^2)+((z(i)-zs)^2);
end
Output is an array 1x77, but I need 77x1.
I tried, ti==array 77x1
if isequal(indt,ri)==0;
ri=transpose(ri);
end
But it didn't work.
I'm new to MatLAB and can not find a way how to solve it, anyone can help me please?
댓글 수: 2
please define your input variable x,xs,y,ys,z,zs or attach your data.
if your output ri is 1*77 array just use transpose.
ri=randi(10,1,77);
output=ri'
Alisher Khodjaev
2022년 2월 17일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!