From: Frank Bieniek on
Ok we have a project due where we are suppost to make the line say this, after we import a apple file into matlab. It is suppost to say this "“This stock's highest ever closing price was $215.04, which occurred on 19-Jan-10” When i try tho I get this

fprintf('This stocks highest ever closing price was %.2f has which occurred on 19-Jan-10.\n', name, x)
This stocks highest ever closing price was 72.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 103.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 104.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 115.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 116.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 32.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 112.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 114.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 99.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
This stocks highest ever closing price was 215.04 has which occurred on 19-Jan-10.

For some reason it puts in all these lins instead of it saying 215.04 ... I am bad at Matlab any help is greatly appreciated
From: Akshay Chaudhari on
"Frank Bieniek" <frankiemets(a)yahoo.com> wrote in message <hkisuq$jgr$1(a)fred.mathworks.com>...
> Ok we have a project due where we are suppost to make the line say this, after we import a apple file into matlab. It is suppost to say this "&#8220;This stock's highest ever closing price was $215.04, which occurred on 19-Jan-10&#8221; When i try tho I get this
>
> fprintf('This stocks highest ever closing price was %.2f has which occurred on 19-Jan-10.\n', name, x)
> This stocks highest ever closing price was 72.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 103.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 104.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 115.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 116.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 32.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 112.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 114.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 99.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> This stocks highest ever closing price was 215.04 has which occurred on 19-Jan-10.
>
> For some reason it puts in all these lins instead of it saying 215.04 ... I am bad at Matlab any help is greatly appreciated

Whats the code that you have? It seems to be running in a for loop, that's my guess.
From: Frank Bieniek on
"Akshay Chaudhari" <sickofhotmail(a)gmail.com> wrote in message <hkiudk$hln$1(a)fred.mathworks.com>...
> "Frank Bieniek" <frankiemets(a)yahoo.com> wrote in message <hkisuq$jgr$1(a)fred.mathworks.com>...
> > Ok we have a project due where we are suppost to make the line say this, after we import a apple file into matlab. It is suppost to say this "&#8220;This stock's highest ever closing price was $215.04, which occurred on 19-Jan-10&#8221; When i try tho I get this
> >
> > fprintf('This stocks highest ever closing price was %.2f has which occurred on 19-Jan-10.\n', name, x)
> > This stocks highest ever closing price was 72.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 103.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 104.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 115.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 116.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 32.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 112.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 114.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 99.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> > This stocks highest ever closing price was 215.04 has which occurred on 19-Jan-10.
> >
> > For some reason it puts in all these lins instead of it saying 215.04 ... I am bad at Matlab any help is greatly appreciated
>
> Whats the code that you have? It seems to be running in a for loop, that's my guess.

I put
name =

Highest price

>> x = 215.04

x =

215.0400

Can we talk through aim if u dont mind?
From: Akshay Chaudhari on
"Frank Bieniek" <frankiemets(a)yahoo.com> wrote in message <hkj0f8$kht$1(a)fred.mathworks.com>...
> "Akshay Chaudhari" <sickofhotmail(a)gmail.com> wrote in message <hkiudk$hln$1(a)fred.mathworks.com>...
> > "Frank Bieniek" <frankiemets(a)yahoo.com> wrote in message <hkisuq$jgr$1(a)fred.mathworks.com>...
> > > Ok we have a project due where we are suppost to make the line say this, after we import a apple file into matlab. It is suppost to say this "&#8220;This stock's highest ever closing price was $215.04, which occurred on 19-Jan-10&#8221; When i try tho I get this
> > >
> > > fprintf('This stocks highest ever closing price was %.2f has which occurred on 19-Jan-10.\n', name, x)
> > > This stocks highest ever closing price was 72.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 103.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 104.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 115.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 116.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 32.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 112.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 114.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 99.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> > > This stocks highest ever closing price was 215.04 has which occurred on 19-Jan-10.
> > >
> > > For some reason it puts in all these lins instead of it saying 215.04 ... I am bad at Matlab any help is greatly appreciated
> >
> > Whats the code that you have? It seems to be running in a for loop, that's my guess.
>
> I put
> name =
>
> Highest price
>
> >> x = 215.04
>
> x =
>
> 215.0400
>
> Can we talk through aim if u dont mind?

I think it's an easy fix. What I do not get is why you declared the name to be Highest Price.
When we take a look at your fprintf statement, the first (and only) variable there is the %.2f, which is a floating value to the second decimal. But, you are trying to assign that to the 'name', because that is the first structure that you are calling. If you change it to:
fprintf('This stocks highest ever closing price was %.2f has which occurred on 19-Jan-10.\n', x)
you should be fine.
From: Frank Bieniek on
"Akshay Chaudhari" <sickofhotmail(a)gmail.com> wrote in message <hkj1f4$ld4$1(a)fred.mathworks.com>...
> "Frank Bieniek" <frankiemets(a)yahoo.com> wrote in message <hkj0f8$kht$1(a)fred.mathworks.com>...
> > "Akshay Chaudhari" <sickofhotmail(a)gmail.com> wrote in message <hkiudk$hln$1(a)fred.mathworks.com>...
> > > "Frank Bieniek" <frankiemets(a)yahoo.com> wrote in message <hkisuq$jgr$1(a)fred.mathworks.com>...
> > > > Ok we have a project due where we are suppost to make the line say this, after we import a apple file into matlab. It is suppost to say this "&#8220;This stock's highest ever closing price was $215.04, which occurred on 19-Jan-10&#8221; When i try tho I get this
> > > >
> > > > fprintf('This stocks highest ever closing price was %.2f has which occurred on 19-Jan-10.\n', name, x)
> > > > This stocks highest ever closing price was 72.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 103.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 104.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 115.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 116.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 32.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 112.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 114.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 105.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 99.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 101.00 has which occurred on 19-Jan-10.
> > > > This stocks highest ever closing price was 215.04 has which occurred on 19-Jan-10.
> > > >
> > > > For some reason it puts in all these lins instead of it saying 215.04 ... I am bad at Matlab any help is greatly appreciated
> > >
> > > Whats the code that you have? It seems to be running in a for loop, that's my guess.
> >
> > I put
> > name =
> >
> > Highest price
> >
> > >> x = 215.04
> >
> > x =
> >
> > 215.0400
> >
> > Can we talk through aim if u dont mind?
>
> I think it's an easy fix. What I do not get is why you declared the name to be Highest Price.
> When we take a look at your fprintf statement, the first (and only) variable there is the %.2f, which is a floating value to the second decimal. But, you are trying to assign that to the 'name', because that is the first structure that you are calling. If you change it to:
> fprintf('This stocks highest ever closing price was %.2f has which occurred on 19-Jan-10.\n', x)
> you should be fine.


Thanks, literally first thing I did on matlb, thanks again