HOW TO REMOVE QUOTE MARK ?

4 vues (au cours des 30 derniers jours)
Amr Hashem
Amr Hashem le 17 Sep 2015
Commenté : Amr Hashem le 17 Sep 2015
I have a data (4259*1 cell ) ex: '9'
I want to remove the quotes mark
i try :
j=1;
for i=1:R
D(j)=t{i};
j=j+1;
end
w=D';
but its fake remove them as when i try to use the numbers or copy to excel the quotes appear again
how to remove the quotes or convert them to (4259*1 double)?
  1 commentaire
Image Analyst
Image Analyst le 17 Sep 2015
Show your code. It looks like you're trying to do something with xlswrite('vital signs.xlsx'.....) but we can't see it. What do you want? Do you want to write t, D, or w to a workbook file? And you want the workbook file to be numbers, not strings with quotes in front of them?

Connectez-vous pour commenter.

Réponse acceptée

Kirby Fears
Kirby Fears le 17 Sep 2015
Modifié(e) : Kirby Fears le 17 Sep 2015
Hi amr,
You shouldn't be copying the values out of the variable editor like that.
Try using
xlswrite('output.xlsx',t);
This will directly write the values to excel for you without parentheses.
Hope this helps.
  1 commentaire
Amr Hashem
Amr Hashem le 17 Sep 2015
thanks kirby ... it works

Connectez-vous pour commenter.

Plus de réponses (2)

Jon
Jon le 17 Sep 2015
What happens if you try
tnum = str2num(cell2mat(t));
  2 commentaires
Walter Roberson
Walter Roberson le 17 Sep 2015
str2double() is better than str2num()
Amr Hashem
Amr Hashem le 17 Sep 2015
an error:
Error using ==> cell2mat at 55
Cannot support cell arrays containing cell arrays or
objects.

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 17 Sep 2015
str2double(t)
  1 commentaire
Amr Hashem
Amr Hashem le 17 Sep 2015
it converts all cells to NAN
(4259*1 double ) but all are NAN

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by