Data .mat of three different variables x,y,z . Each variable has a list, I need to save those lists in form of matrices [x1,y1,z1] , [x2,y2,z2], etc.

1 回表示 (過去 30 日間)
dx=(Sub3.Left.Vel(:,1)); %import data x in form of column
dxt=dx.'; %from column to list
dy=Sub3.Left.Vel(:,2); %import data y in form of column
dyt=dy.'; %from column to list
dz=Sub3.Left.Vel(:,3); %import data z in form of column
dzt=dz.'; %from column to list
dxdt=zeros(3,1); %Matrix of form 1x3
dxdt=[dxt;dyt;dzt]; %Save dxt in 1x1 matrix postion, save dyt in 2x1 matrix postion, dzt in 3x1 matrix postion
  2 件のコメント
Adam Danz
Adam Danz 2021 年 2 月 15 日
No need to preallocate: dxdt=zeros(3,1);
Are you getting an error? What's the problem?
Samah Salha
Samah Salha 2021 年 2 月 15 日
yeah, I was getting some errors, but it is working now! Thank you

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

採用された回答

Adam Danz
Adam Danz 2021 年 2 月 15 日
dxdt = Sub3.Left.Vel(:,1:3)';

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by