how do you hide an output?

I have a name where I am using the string function (strtok) to extract specific things out of the name for example
abc_pD_34Vg30.csv
[junk, name]=strtok(file(3),'_p');
[right,name]=strtok(name,'_p')
[left,name]=strtok(name,'_V')
i want to hide the output of name and have the right and left output viewable. How do i hide only the output name?
[EDITED, code formatted, Jan]

1 commentaire

Jan
Jan le 16 Juil 2012
@Leah: You have overwritten your former question http://www.mathworks.com/matlabcentral/answers/43164-asdffdasdfdsdfdddddddddd-asd-asdf-sadfa-dadsf with nonsense. Now the work I've spend for posting my answer in this thread is lost for the community. In consequence I will not answer to your questions anymore.

Connectez-vous pour commenter.

Réponses (2)

Caleb
Caleb le 16 Juil 2012

1 vote

Might try this:
[junk, name]=strtok(file(3),'_p');
[right,name]=strtok(name,'_p');
[left,name]=strtok(name,'_V');
disp(junk);
disp(right);
disp(left);

4 commentaires

Leah
Leah le 16 Juil 2012
thank you!! but how do i make it so that instead of displaying what junk, right, and left is how do i display that junk=.... and right=.... and left=....instead of only showing ....
thanks for your help!
Change
disp(junk);
disp(right);
disp(left);
to
junk
right
left
Caleb
Caleb le 23 Juil 2012
You mean like this?
strcat('junk=',num2str(junk))
Walter Roberson
Walter Roberson le 23 Juil 2012
That would also display "ans ="

Connectez-vous pour commenter.

joeDiHare
joeDiHare le 16 Juil 2012

0 votes

try:
[~, name]=strtok(file(3),'_p'); [right,~]=strtok(name,'_p') [left,~]=strtok(name,'_V')

Question posée :

le 16 Juil 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by