How to change structure fields from 1 x Y double to Y x 1 double (Horizontal;1 row,Y columns to Vertical;1 column,Y rows)

3 ビュー (過去 30 日間)
I am modelling a lithium battery cell and want to import data. The input data is current and voltage and the current input is attached to an S-PS converter so the output of the current data and input of converter sizes must match. When i run importfile.m a structure SP1OCVT00 is created with 4 fields each 1x157569 double. I want to change it so that the generated structure contains four fields with each being a 157569x1 double. I am unsure how to change the .m file to achieve this. Any help appreciated.
.m file attached.

採用された回答

RobF
RobF 2018 年 1 月 24 日
Maybe a little change to your code will do the job (just transpose the imported arrays):
SP1OCVT00 = struct('Test_time',[raw{:,1}]','Current',[raw{:,3}]','Voltage',[raw{:,4}]',...
'Temperature',[raw{:,2}]');
  1 件のコメント
Peadar Crudden
Peadar Crudden 2018 年 1 月 24 日
Legend thank you so much. I was putting .' everywhere but after the bracket and kept receiving balancing errors.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by