is it possible in matlab, to make arrays of a cell matrix, linkable to a special path?(linkable:with clicking on that arrays an special figurue to be shown)

5 ビュー (過去 30 日間)
is it possible in matlab, to make arrays of a cell matrix, linkable to a special path?(linkable:with clicking on that arrays an special figurue to be shown)
  2 件のコメント
Fangjun Jiang
Fangjun Jiang 2011 年 9 月 15 日
What special figure? Do you want to plot the array you clicked?
mohammad
mohammad 2011 年 9 月 15 日
sorry for late, i see your comment now. by clicking on a array for example {2,3} i want to plot two EXCEL files that their names are located in {1,3} and {2,1} and also these .xls files are located in a path that I know it

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2011 年 9 月 15 日
When you say "clicking on that array", what do you mean? When the array is displayed in the variable inspector? Or when it is being displayed in a GUI you constructed? In a uitable perhaps?
  2 件のコメント
mohammad
mohammad 2011 年 9 月 15 日
please see answer 2 (sorry for making code its needed to answer and with command i can't do this)
Walter Roberson
Walter Roberson 2011 年 9 月 15 日
If you are referring to outputting hyperlinks in the command window, please see http://blogs.mathworks.com/desktop/2007/07/09/printing-hyperlinks-to-the-command-window/

サインインしてコメントする。

その他の回答 (2 件)

mohammad
mohammad 2011 年 9 月 15 日
for example Find is a common cell like this:
Find =
'Refrences\Inputs ' 'a.xls' 's.xls'
'R1.xls' ' M' ' N'
'R2.xls' ' N' ' N'
'3.xls' ' N' ' M'
'4.xls' ' N' ' N'
'R5.xls' ' N' ' N'
'6.xls' ' N' ' M'
'7.xls' ' N' ' N'
'R8.xls' ' N ' L'
'9.xls' ' M' ' N'
'10.xls' ' L' ' N'
'11.xls' ' N' ' N'
now while clicking on Find {i,j} (i>1 ,j>1) to go a defined path
  12 件のコメント
Jan
Jan 2011 年 9 月 15 日
@Mohammad: Walter's question is very clear and I'd be interested in the answer also.
mohammad
mohammad 2011 年 9 月 16 日
thanks Walter and Jan
please see answer3

サインインしてコメントする。


mohammad
mohammad 2011 年 9 月 16 日
some other explanations and codes: there are 3 m-files, one is common(method.m) and 2 others are functions(operation.m and operationR.m). also there are two folders in names of 'inputs' and 'references'. by running method.m, first it looks at 'inputs' folder and gets how many .xls files to be exist. for example there are 2 .xls files with names of 'a.xls' and 's.xls'. then here (in method.m) we have a for-loop from i=1:2 (2=numel(dir('*.xls')). code of method.m is:
cd([z2, '\inputs'])%z2 is a directory name for example f:
d = dir('*.xls');
for o = 1:numel(d)
if o==1 % here 'Find2' cell is defined that its only for one time
cd([z2, '\refrences'])
b = dir('*.xls');
Find2=cell(numel(b)+1,numel(d)+1);
else
Find2= Find;
end
end
cd([z2, '\inputs'])
r = xlsread(d(o).name,2);
dfile=d(o).name;
InputNames{o}=sprintf(d(o).name,o); %here it's creating first row of 'Find' with names of .xls files that are existing in 'inputs' folder
[Find,ReferenceNames]=operation(r,dfile,o,InputNames,Find2) % here operation.m function is called to do some thing and computing on 'r' matrix (r =xlsread(d(o).name,2)) and this function is in the first for-loop (o=1:numel(d)).
Find{1,1} = 'Refrences\Inputs';
Find(2:end,1) = ReferenceNames;
Find(1,2:end) = InputNames;
Find % here 'Find' displays in command window
operation.m function:
%here first peaks of 'r' is found( that i dont show these commands) then it is going to define matrix for references .xls files to do same analyzing on (finding peaks of) references .xls files in other m-function in name of operationR.m
some command for finding peaks of 'r' and these peaks are in 'peaks' matrix
peaks;
cd([z2, '\refrences'])
b = dir('*.xls');
for u = 1:numel(b) %second loop
R_H_1 = xlsread(b(u).name,2);
if u==1 && 0==1 %here 'Find2' is defined for only one time
Result=cell(numel(b)+1,numel(d)+1);
end
cd(z2);
[R_peaks]=operationR(R_H_1,peaks); % here peaks of refrences are founded
ReferenceNames{u}=sprintf(b(u).name,u); %here first column of 'Find' is creating
if R_peaks==peaks
Find2{u+1,o+1}='M'
else
Find2{u+1,o+1}=' N';
end
end
Find=Find2;
  6 件のコメント
Walter Roberson
Walter Roberson 2011 年 9 月 17 日
Don't put in 3 or more commands: write a function that takes two arguments and does the plotting for you. The two arguments would be the two file names to use for that particular plot.
mohammad
mohammad 2011 年 9 月 17 日
So much thanks Walter
really nice

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by