How to get a matrix in GUI as an input

I am going to make a GUI and in my code I need to get a 3*3 matrix as an input. I prefer to have something like a 3*3 table with empty slots and user could be able to fill the slots that would be the input for my matrix. please tell me how to do this.

1 comentario

Jan
Jan el 15 de En. de 2013
Do you create the GUI by GUIDE or programmatically? What have you tried so far? Which problems occurred?

Iniciar sesión para comentar.

Respuestas (2)

Shashank Prasanna
Shashank Prasanna el 15 de En. de 2013

0 votos

Are you looking at an editable table? If you are then this file central submission must be of some help:
If you just want to programmatically input a matrix via an input argument and then display it in a table then you can use UITABLE as described in the documentation:
and say set(t,'Data',my_input_matrix)
and you should see it displayed.

1 comentario

Poorna Chandar Reddy
Poorna Chandar Reddy el 11 de Jul. de 2014
Editada: Poorna Chandar Reddy el 11 de Jul. de 2014
Hai Shashank Bro. .. i need help to create table of boxes. . i.e., matrix of boxes. .
>>

Iniciar sesión para comentar.

Image Analyst
Image Analyst el 15 de En. de 2013
You can use GUIDE. There is an icon for a table. Click it and draw out a table on your GUI. Then your user runs your program and fills out the table. Then to get the data in your code (for example in the callback function of a push button), you do this:
tableData = get(handles.uitable1, 'Data');

3 comentarios

well actually I have written my code completely before, but now I want to make an UI for it in order to make it user friendly. my code gets an 3*3 matrix as an input and use this matrix for mapping 8 points of a cube and after that we have 8 new points. here is the code :
% code
end
vertex_matrix=[0 0 0;1 0 0;1 1 0;0 1 0;0 0 1;1 0 1;1 1 1;0 1 1];
clc;
faces_matrix=[1 2 6 5;2 3 7 6;3 4 8 7;4 1 5 8;1 2 3 4;5 6 7 8];
patch('Vertices',vertex_matrix,'Faces',faces_matrix,'FaceVertexCData',hsv(6),'FaceColor','flat');
view(3);
hold on
F=zeros(3,3);
for i=1:3
for j=1:3
F(i,j)=input('Enter F matrix parameters ');
end;
end;
disp('F= ');
disp(F);
disp('Determinant of F= ');
for i=1:8 b=zeros(1,3); b=vertex_matrix(i,:);
c=zeros(3,1);
c=F*[b]';
vertex_matrix(i,:)=c;
end;
disp(vertex_matrix);
figure;
patch('Vertices',vertex_matrix,'Faces',faces_matrix,...
'FaceVertexCData',hsv(6),'FaceColor','flat');
view(3);
as you can see it produces a cube at first and then it produces another cubewise volume. i want that user input the 9 parameters of matrix( that now im getting them bu input! one by one) in table then my code starts running and those two figures appear in my GUI. hope you now you know what i want.
Obikaonu Kelechi
Obikaonu Kelechi el 28 de Mayo de 2014
Please I also have a similar problem but from the look of things I won't be needing a UItable because I am not displaying the result of the matrix operation. So my problem is how do I make my text boxes accept random matrices...Thanks.
Poorna Chandar Reddy
Poorna Chandar Reddy el 11 de Jul. de 2014
Sir. .. i need help to create table of boxes. . i.e., matrix of boxes. .
>>

Iniciar sesión para comentar.

Categorías

Más información sobre Mathematics en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 15 de En. de 2013

Comentada:

el 11 de Jul. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by