Borrar filtros
Borrar filtros

Producing different output files by entering an input array

2 visualizaciones (últimos 30 días)
Ellen
Ellen el 25 de Ag. de 2014
Respondida: Ellen el 25 de Ag. de 2014
Hi all,
I have written a matlab script with which I'd like to calculate the sensitivity of certain processes to e.g. temperature. To do so, I wrote a script that needs a certain temperature as input, runs the equations and saves an output file. However, as I have to study ranges of temperatures, I was wondering if it's possible to input the range of temperatures as an array and tell the model to run for each temperature in the array and save a separate output file for each temperature. This to avoid the necessity to manually change the temperature and run the model for each temperature :).
Do you have any tips or tricks to set this up?
Thanks a lot,
Ellen

Respuestas (2)

Manoj
Manoj el 25 de Ag. de 2014
Editada: Manoj el 25 de Ag. de 2014
temperature=(10:10:100);
equation=zeros(size(temperature));
for i=1: length(temperature)
equation(i)=temperature(i)*5;
end
Hope this helps you can add your equations in the for loop as provided to calculate the sensitivities.
Best Regards
Manoj

Ellen
Ellen el 25 de Ag. de 2014
Thanks Manoy, that's helpfull. However, as I understand, Matlab can get very slow when executing heavy calculations in a loop (I have to calculate some elliptic integrals which are pretty heavy). So maybe it might be interesting if someone else has other ideas?
Thanks, Ellen

Categorías

Más información sobre Programming en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by