How can I load and save a excel data file (which has negative values in some rows) in MATLAB as an executable double. I tried and it gives me NAN for negative values. Here is the file. Thanks.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
az
el 15 de Oct. de 2018
Comentada: az
el 15 de Oct. de 2018
Hello I am using MATLAB 2018a. How can I load and save a excel data file (which has negative values in some rows) in MATLAB as an executable double. I tried and it gives me NAN for negative values. Here is the file. Thanks.
1 comentario
Respuesta aceptada
the cyclist
el 15 de Oct. de 2018
The problem is that in the Excel file, those are not negative signs in those numbers -- they are dashes or some other character. Therefore, they are interpreted as text, not as numbers.
If you globally replace those characters with negative signs (i.e. hyphens), then
x2 = xlsread('index2.xlsx')
will read it just fine. I've done that in the attached file.
4 comentarios
the cyclist
el 15 de Oct. de 2018
What I did to create my index2 file was to go into a single cell, and copy that dash symbol onto the clipboard. Then I did a global replace with a hyphen, and save.
Más respuestas (1)
madhan ravi
el 15 de Oct. de 2018
Editada: madhan ravi
el 15 de Oct. de 2018
[num,~,~] = xlsread('index.xlsx')
Datas = num
Now we can manipulate the data’s as we want.
5 comentarios
madhan ravi
el 15 de Oct. de 2018
Editada: madhan ravi
el 15 de Oct. de 2018
Follow cyclist’s instructions
Ver también
Categorías
Más información sobre Data Import from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!