Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Need help in the code GUI!
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi there,
i have some problems with the Gui code. I need to calculate the difference on all the 6 images and display it with the command colormap using my formula.
Heres the code:
-------------------------------
global I1c I2c I3c I4c I5c I6c; // the image
global theta1 theta2 ftheta;
global delta1 delta2 delta3 fdelta;
global averagef N stress;
dia = str2num(get (handles.thickness, 'String'));
fringe = str2num(get (handles.fringe2, 'String'));
theta1=I5c-I3c;
theta2=I4c-I6c;
ftheta=(1/2)*atan(theta1.*theta2);
delta1=I5c-I4c;
delta2=I1c-I2c;
delta3=sin(2.*ftheta)-cos(2.*ftheta);
fdelta=atan(2.*(delta1./(delta2.*delta3)));
N=fdelta./(2*pi);
stress=(N*averagef)/dia;
set(handles.stressDifference, 'String', stress);
axes(handles.axes11)
imagesc(abs(stress)),title('Stress distribution in the tooth'),xlabel('Pixel'),ylabel('Pixel'),colorbar,colormap(jet);
---------------------------------------------
Heres the error:
??? Error using ==> mtimes Inner matrix dimensions must agree.
Error in ==> New>StressButton_Callback at 846 stress=(N*averagef)/dia;
Error in ==> gui_mainfcn at 96 feval(varargin{:});
Error in ==> New at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)New('StressButton_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
I need help in this! THANKS!
0 Kommentare
Antworten (1)
Image Analyst
am 22 Nov. 2012
You're doing a matrix multiplication (not an element-by-element multiplication) of N and averagef. They are different sizes. Set a breakpoint there and find out what sizes they are. Learn how to use the debugger and these kinds of problems can be solved in seconds without the long delay involved in asking us.
0 Kommentare
Diese Frage ist geschlossen.
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!