Importdata problem
Afficher commentaires plus anciens
Hello, I´d like to do a GUI thtat shows two differents lines. Each line is represented throw a file.dat.
First, I look for the library, and I have:
uigetdir --> library='C:\Users\Jhon\Desktop\';
handles.Library=library;
After, I must choose a file:
if hObject==handles.one
file='Data\file1.dat';
elseif hObject==handles.two
file='Data\file2.dat'
end
handles.File=file;
Then
Library=handles.Library
File=handles.File
Direction=strcat(Library,'\',File)
a=importdata(Direction)
m=a.data;
axes(handles.axes1);
plot(m(:,1),m(:,2),'bo-')
But I have a problem:
Direction=
'C:\Users\Jhon\Desktop\Data\file1.dat'
and importdata don´t works.
If I write: Direction='C:\Users\Jhon\Desktop\Data\file1.dat', matlab will show:
Direction= C:\Users\Jhon\Desktop\Data\file1.dat --> (there aren´t '')
and importdata works.
What can I do?
1 commentaire
Oleg Komarov
le 24 Mar 2012
Please format the code: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
Réponses (0)
Catégories
En savoir plus sur Data Import and Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!