How to create windows forms in MATLAB?
Mostra commenti meno recenti
I want to know how to create windows forms using MATLAB? Will it be like vb.net?
Risposta accettata
Più risposte (2)
Jan
il 31 Gen 2011
0 voti
Please explain what you mean with "windows forms". If you look for graphical user interfaces, read the correpsonding chapters in the documentation.
Frank Cano
il 15 Apr 2019
0 voti
clc;
clear all;
A=[3 4 5 6; 2 3 4 5; 5 6 4 3; 9 8 7 6]
% For bringing the max value of each column at its top
for i=1:length(A)
V=A(:,i); % Separate the column of intrest and save it as a vector V
temp=V(1) % Save its top value so that it does not vanish by over-writing
MAX=max(V); % find the max value in the vector
[nr nc]=find(V==MAX); % find the location of the max value in the form of row number(nr) and column number (nc)
V(1)=MAX; % Now shift the max value to the top by over writing existing value
V(nr,nc)=temp; % bring back the saved value of top element in temp and write it where the MAX was located
A(:,i)=V; % Now your vector is updated.Give it back to matrix A at the right location by over-writing
end
A % Just checking the final result is correct or not
save datafile.dat A -ascii %You can save the matrix in a data file
% For bringing the max value of each column at its diagonal position
for i=1:length(A)
V=A(:,i); % Separate the column of intrest and save it as a vector V
temp=V(i) % Save its appropriate element value so that it does not
vanish by over-writing
MAX=max(V); % find the max value in the vector
[nr nc]=find(V==MAX); % find the location of the max value in the form
of row number(nr) and column number (nc)
V(i)=MAX; % Now shift the max value to the appropriate element
by over writing existing value
V(nr,nc)=temp; % bring back the saved value of appropriate element in
temp and write it where the MAX was located
A(:,i)=V; % Now your vector is updated.Give it back to matrix A
at the right location by over-writing
end
% For bringing the min value of each column at its diagonal position
for i=1:length(A)
V=A(:,i); % Separate the column of intrest and save it as a vector V
temp=V(i) % Save its appropriate element value so that it does not
vanish by over-writing
MAX=min(V); % find the min value in the vector
[nr nc]=find(V==MAX); % find the location of the min value in the form
of row number(nr) and column number (nc)
V(i)=MAX; % Now shift the min value to the appropriate element
by over writing existing value
V(nr,nc)=temp; % bring back the saved value of appropriate element in
temp and write it where the MAX was located
A(:,i)=V; % Now your vector is updated.Give it back to matrix A
at the right location by over-writing
end
% For bringing the max value of each column at its diagonal position
% starting from the last column in reverse order
for i=1:length(A)
V=A(:,length(A)-i+1); % Separate the column of intrest and save it
as a vector V
temp=V(i) % Save its appropriate element value so that it does not
vanish by over-writing
MAX=max(V); % find the max value in the vector
[nr nc]=find(V==MAX); % find the location of the max value in the form of row number(nr) and column number (nc)
V(i)=MAX; % Now shift the max value to the appropriate element by over writing existing value
V(nr,nc)=temp; % bring back the saved value of appropriate element in temp and write it where the MAX was located
A(:,length(A)-i+1)=V; % Now your vector is updated.Give it back to matrix A at the right location by over-writing
end
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!