필터 지우기
필터 지우기

HOW TO REMOVE QUOTE MARK ?

조회 수: 1 (최근 30일)
Amr Hashem
Amr Hashem 2015년 9월 17일
댓글: Amr Hashem 2015년 9월 17일
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
Image Analyst
Image Analyst 2015년 9월 17일
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?

댓글을 달려면 로그인하십시오.

채택된 답변

Kirby Fears
Kirby Fears 2015년 9월 17일
편집: Kirby Fears 2015년 9월 17일
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
Amr Hashem
Amr Hashem 2015년 9월 17일
thanks kirby ... it works

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

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

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2015년 9월 17일
str2double(t)
  댓글 수: 1
Amr Hashem
Amr Hashem 2015년 9월 17일
it converts all cells to NAN
(4259*1 double ) but all are NAN

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by