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)

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 Comments

What special figure? Do you want to plot the array you clicked?
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

Sign in to comment.

 Accepted Answer

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 Comments

please see answer 2 (sorry for making code its needed to answer and with command i can't do this)
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/

Sign in to comment.

More Answers (2)

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 Comments

Again, what do you mean by "clicking" on that? Are you referring to displaying it in the command window and having those fields come out as links? Or are you talking about the variable inspector? Or are you talking about putting things in a uitable ?
I mean for example by clicking on Find{3,2} (in .mat format of Find or in command window ), plots a.xls and R2.xls
@Moahammad: It is still unclear. How or where can you click on "Find{2,3} in .mat format"? You have shown us a table of strings. Where should this appear? And how can "a.xls" be plotted?
I click by mouse and in command window and this table of strings appears on command window. a.xls saved in a matrix in the name of 'input' for i=1(in a loop) i mean for i=1, input=xlsread('a.xls'). and for i=2 (in a loop) input=xlsread('s.xls')
You can use a matlab: hyperlink as shown in the blog posting I referenced. In order to output the hyperlinks, some code would have to be run to reformat the display of the cells.
Unfortunately you have not indicated where you are clicking, and until I know that I do not wish to spend speculating about what you might mean.
I want to click in command window when 'Find' is displaying in command window('Find' is the cell that I showed in answer2) and I want to click on arrays of 'Find' in command window for plotting two excel files that the name of them are located in {1,the column number of clicking array} and {the row number of clicking array,1}
Okay, now how did 'Find' get displayed in the command window?
If you are willing to run code that specially formats the variable and displays it to the command window, that that is practical.
I am, though, a bit unclear on exactly what you want plotted. In your comment above you seem to have two "for" loops. Are there multiple columns in the .xls file? If so then how do you want the multiple columns dealt with?
'Find' are displayed exactly in the same form that I showed in answer2, in command window. you are right, there are 2 loops: first for names of inputs that locate in first row of 'Find" and second loop is for names of references that locate in first column (Find{1,1}='Refrences\Inputs '). in .xls files there are 2 columns and more than 10000 rows.
My question is "What action was taken in order to display 'Find' in the command window?"
@Walter let me studying about the link that you referred in answer1
maybe it will take more than 5 hours
thanks
@Mohammad: Walter's question is very clear and I'd be interested in the answer also.

Sign in to comment.

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 Comments

'Find' cell is created like above. now its needed to plot two .xls file that saved in matrix 'r' and 'R_H_1' by clicking on each array of 'Find', in command window. for example while clicking on Find{2,3} its needed to plot EXCEL files that the names of them are located in {1,3} and {2,1} and also these .xls files are located in respectively in 'inputs' folder and 'references' folder.
Walter thanks for that link
when i want to make arrays of a matrix, hyperlinks, it gives some numbers instead of hyperlinks. for example:
d=[];
d(1,1)=fprintf('<a href="matlab: plot(magic(10))">plot</a>');
d(1,2)=fprintf('<a href="matlab: plot(magic(10))">plot</a>');
d(1,3)=fprintf('<a href="matlab: plot(magic(10))">plot</a>');
answer of d equals to:
d =
42 42 42
now how can this use for making arrays of a matrix, hyperlinks?
d={};
d{1,1}=sprintf('<a href="matlab: plot(magic(10))">plot</a>');
d{1,2}=sprintf('<a href="matlab: plot(magic(10))">plot</a>');
d{1,3}=sprintf('<a href="matlab: plot(magic(10))">plot</a>');
perfect great
Walter please tell me how can I subplot 3 matrix or how plot 3 matrix with hold on, instead of "plot(magic(10))"
in other words how we can put 3 or more commands instead of one command?
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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!