Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: fprintf to cell array

$
0
0
On 7/4/2013 6:10 PM, Paul wrote:
> Hello,
> I am using this command:
>
> fprintf('%3.2f %s ',B(1,1),'±',sdotm(1,1))
>
> to output:
>
> -0.02 ± 0.08
>
> I need to assign this output to an element of a cell array. How can this be done?
>
> Thanks!
>

put the result in a variable. Then put this variable in the cell
array. Use sprintf

EDU>> s=sprintf('%3.2f %s ',-0.02,'±',0.08)

s =

-0.02 ± 0.08

Viewing all articles
Browse latest Browse all 19628

Trending Articles