Importdata problem

4 visualizzazioni (ultimi 30 giorni)
Xenxo
Xenxo il 24 Mar 2012
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 Commento
Oleg Komarov
Oleg Komarov il 24 Mar 2012
Please format the code: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Data Import and Analysis in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by