Importdata problem

4 次查看(过去 30 天)
Xenxo
Xenxo 2012-3-24
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 个评论
Oleg Komarov
Oleg Komarov 2012-3-24
Please format the code: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Import and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by