How to reshape a cell array ?
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Baran Mehrdad
am 24 Sep. 2018
Kommentiert: Adam Danz
am 29 Sep. 2018
Hi , I have a this cells :

I want to reshape them , I want each cell include a 95*1 cells which all 95 data are the same value we have for the cell before reshaping. for example look at row 27 . the value is 5.9410 . I want it to be a 95*1 cell which all of the rows has the value of 5.9410. (pls forget about row 28 and assume that in each row we have a single value)
3 Kommentare
Akzeptierte Antwort
Adam Danz
am 24 Sep. 2018
Assuming the data stored in ESS_estimated_schedule is a cell array,
cellfun(@(x){repmat(x,95,1)},ESS_estimated_schedule)
13 Kommentare
Adam Danz
am 29 Sep. 2018
I think I see the cause of your problem now. It's in this line of your code:
[battery_paramaters,ESS_estimated_schedule{Schedule_index}]=obtain_current_SoC(battery_paramaters,opt_prmt(1),CT{Schedule_index}(1),DCT{Schedule_index}(1),Current_week_actual_load_data_reshape{Schedule_index}(1));
I believe CT{Schedule_index} and Current_week_actual_load_data_reshape{Schedule_index} are vectors and in the line above you are only passing the first element of those vector into obtain_current_SoC(). Remove (1) from your inputs if you want to pass the full vectors into that function.
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


