<div dir="ltr">Thanks all for the solution!<div><br></div><div>Cheers</div><div>Lester</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 7 Apr 2022 at 11:02, Stefan Du Rietz <<a href="mailto:sdr@durietz.se">sdr@durietz.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Of course you don't need to make the string s.<br>
<br>
You have to transpose fac to get a column vector for mprintf and then <br>
transpose the column string vector to get a row string vector:<br>
<br>
--> fac = msprintf("%d\n", fac')'<br>
fac =<br>
"7" "13" "19"<br>
<br>
and then concatenate the string so that it works for a variable number <br>
of elements in fac:<br>
<br>
--> mprintf("Factors of 1729 are: %s", strcat(fac," "))<br>
<br>
Stefan<br>
<br>
<br>
On 2022-04-07 11:30, Stefan Du Rietz wrote:<br>
> Hello Lester,<br>
> <br>
> --> s = msprintf("Factors of 1729 are: ");<br>
> s =<br>
> "Factors of 1729 are: "<br>
> --> fac = msprintf("%d\n", fac')'<br>
> fac =<br>
> "7" "13" "19"<br>
> --> mprintf("%s%s", s, strcat(fac, " "))<br>
> Factors of 1729 are: 7 13 19<br>
> <br>
> Regards<br>
> Stefan<br>
> <br>
> <br>
> On 2022-04-07 09:50, Lester Anderson wrote:<br>
>> Hello all,<br>
>><br>
>> Very basic query but how do you print all the values from a result via <br>
>> mprintf?<br>
>><br>
>> e.g.<br>
>><br>
>> fac = factor(1729)<br>
>> 7 13 19<br>
>><br>
>> mprintf('Factors of 1729 are: %d\n', fac)<br>
>> just prints 'Factors of 1729 are: 7<br>
>><br>
>> Sorry for the basic question!<br>
>> Cheers<br>
>> Lester<br>
>><br>
>> _______________________________________________<br>
>> users mailing list<br>
>> <a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
>> <a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
> _______________________________________________<br>
> users mailing list<br>
> <a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
> <a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>