For loop

Vectorized set param in matlab

The following Matlab project contains the source code and Matlab examples used for vectorized set param. Are you like me and finding yourself wanting to change the parameters of multiple Simulink objects at once? Do you run find_system only to then take the output and use it in a for loop that calls set_param? Are you tired of your for loop crashing because a block name has a carriage return or an apostrophe? Well if this is you, I have a simple utility that can make life easier.

Variable blur, gradient blur in matlab

The following Matlab project contains the source code and Matlab examples used for variable blur, gradient blur. The code is probably not very efficient, as it contains a for loop. Any improvement ideas are welcomed. example: ParameterMatrix=abs(meshgrid(0:199)-100) / 20; inputimg = double(checkerboard(10,10,10)>0.5); blurred=VariableBlur(inputimg, ParameterMatrix); imagesc(blurred); colormap(gray);

Display time remaining in a loop v2.1 in matlab

The following Matlab project contains the source code and Matlab examples used for display time remaining in a loop v2.1. If you are tired of waiting for loops to finish, not knowing whether you have enough time to go and get lunch, or a nice cup of tea, then your problems are solved :) This function will display the time left (as a string or vector) in Hrs Mins Secs until the current loop completes all its iterations.

This function allows you to save variables inside a parfor loop. in matlab

The following Matlab project contains the source code and Matlab examples used for this function allows you to save variables inside a parfor loop. . Unlike MATLAB's solution, the variables are saved with their variable names'. You must call this function for each variable you want to save, but the function will not overwrite previous mat files. function parsave(fname,data) var_name=genvarname(inputname(2)); eval([var_name '=data']) try     save(fname,var_name,'-append') catch     save(fname,var_name) end

Worker object wrapper in matlab

The following Matlab project contains the source code and Matlab examples used for worker object wrapper. The WorkerObjWrapper is designed for situations where a piece of data is needed multiple times inside the body of a PARFOR loop or an SPMD block, and this piece of data is both expensive to create, and does not need to be re-created multiple times.
Subscribe to RSS - For loop