How to Arrange NDGRID and CELL data to become more compact in size and use less memory?
1 view (last 30 days)
Show older comments
If my question is not correct im sorry.because im still new in matlab.use matlab less than 1 month.
but i believe the expert guys will understood this question.im facing out of memory after run next code.
my laptop is 8gb RAM for your info.
matlab 64 bit.
%Create Combination
[a,b,c,d,e]=ndgrid(1:20,1:20,1:10,1:10,1:10);
data=[a(:),b(:),c(:),d(:),e(:)];
PV={'20 kinds of spec};
Batt={'20 kinds of spec};
MPPT={'10 kinds of spec};
Inverter={'10 kinds of spec};
DieselGenerator={'10 kinds of spec};
%Insert data into combination
ExpandData=[PV(data(:,1),:), Batt(data(:,2),:), MPPT(data(:,3),:), Inverter(data(:,4),:), DieselGenerator(data(:,5),:)]
Error as below :
Out of memory. Type HELP MEMORY for your options.
Error in Entahla (line 96)
Ireq_cc = 1.25.*Isc_stc.* Nparallel_PV; %equation 15
how to make above data consume more low memory or more faster code ?
1 Comment
Matt J
on 1 May 2021
We cannot tell from your code what kind of data PV, Batt, MMPT, etc... contains. Are they numerbs? strings? cells?
Answers (1)
Matt J
on 1 May 2021
Shouldn't it be,
[a,b,c,d,e]=ndgrid(PV,Batt,MPPT,Inverter,DieselGenerator);
ExpandedData=[a(:),b(:),c(:),d(:),e(:)];
3 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!