Thread Subject: Great, great Request

Subject: Great, great Request

From: Tato Jandieri

Date: 25 Aug, 2009 02:40:21

Message: 1 of 2

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.

    

Subject: Great, great Request

From: Gavrilo Bozovic

Date: 25 Aug, 2009 06:44:02

Message: 2 of 2

"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.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
physical problem Sprinceana 25 Aug, 2009 02:41:02
receivers Sprinceana 25 Aug, 2009 02:41:02
pulses Sprinceana 25 Aug, 2009 02:41:02
rssFeed for this Thread

Contact us at files@mathworks.com