|
"Tato Jandieri" <vjandieri@yahoo.com> wrote in message <h6viul$48e$1@fred.mathworks.com>...
> Hello,
>
> I have a request and please help me. I think it is easy, but I failed.
> It is urgent.
>
> I have a physical problem that I am solving in Matlab.
> I have 4 pulses f1(t), f2(t)... radiated from different receivers R(1), R(2)....
> I have already written a loop for one pulse that characterizes f1(t) pulse propagation in medium:
>
> for t=1:nmax
> ....................
> R(1)=f1(t)
> ...................
> end
>
> My problem is that I would like to consider in the same loop 4 different pulses. When calculation for f1(t) is finished, calculation for f2(t) should start automatically...and so on.
> Of course, I can copy 4 times the same loop for different pulses, but this loop is too big and it is very inconvenient. Please, help me. It is urgent.
>
>
Couldn't you just save the contents of your loop as a function, and call it 4 times, for your 4 pulses? You won't repeat the same part of code 4 times, and, secondarily, it will keep your main code smaller.
Otherwise, you might be able to genrate a matrix out of your 4 pulses and treat it in one loop, but I'm not sure it would be cleaner.
|