Simulink element wise multiplication for big data
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
I'm new to simulink. In matlab i run a function which takes 100000*10 size of data and gives an output of 100000*1 within 2 sec as the function is taking element wise multiplication(.*) instead of running in a for-loop row by row. I want to implement this function in simulink to take the advantage of blocks(to edit the formula easier in later stages). I've created my model but when i try to run the simulation, my laptop freezes(may be because of out of memory). How to perform element wise multiplication instead of time based simulation? Is simulink only for time based simulation? Sample program,
data=rand(100000,10);
map.BP_x=[1,2,3,4,5,6];map.BP_y=[1,2,3,4,5,6];map.data=rand(6,6);
function output=my_fun(data,map)
interpolation_data=interp2(map.BP_x,map.BP_y,map.data);
output=interpolation_data*data(:,1)+data(:,2)+data(:,3)+data(:,4)+data(:,5)+...;
end
5 Commenti
dpb
il 15 Ott 2018
output=interpolation_data.*data(:,1)+sum(data(:,2:8),2);
I've never even seen a Simulink installation so I've zero knowledge about how it actually operates.
I thought a S-function would operate to compute its result with the current inputs at each timestep evolution???
If that's not so, I have nothing I can add, sorry.
Risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!