Hello,
I am trying to run a for loop in the get function and keep encountering problems. Thanks in advance for help and suggestions to resolve this problem. I created a GUI and have three editable textboxs taged text1, text2, and text3 and a push button taged pushbutton1. The code below is in pushbutton1 function. Please find code and error message below.
code:
for b= 1:3
target_temp_string(b) = get(handles.textb, 'String');
end
for c= 1:3
target_temp_string(c)
end
error message:
??? Error using ==> struct2handle
Undefined function or method 'test' for input arguments of type 'char'.
??? Error using ==> test('text3_CreateFcn',gcbo,[],guidata(gcbo))
Error using ==> struct2handle
Undefined function or method 'test' for input arguments of type 'char'.
??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn
??? Error using ==> struct2handle
Undefined function or method 'test' for input arguments of type 'char'.
??? Error using ==> test('text2_CreateFcn',gcbo,[],guidata(gcbo))
Error using ==> struct2handle
Undefined function or method 'test' for input arguments of type 'char'.
??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn
??? Error using ==> struct2handle
Undefined function or method 'test' for input arguments of type 'char'.
??? Error using ==> test('text1_CreateFcn',gcbo,[],guidata(gcbo))
Error using ==> struct2handle
Undefined function or method 'test' for input arguments of type 'char'.
??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn
??? Undefined function or method 'test' for input arguments of type 'char'.
??? Error using ==> test('pushbutton1_Callback',gcbo,[],guidata(gcbo))
Undefined function or method 'test' for input arguments of type 'char'.
??? Error while evaluating uicontrol Callback
|
|
0
|
|
|
|
Reply
|
Victor
|
5/19/2010 9:44:04 PM |
|
On May 19, 2:44=A0pm, "Victor " <victoro...@yahoo.com> wrote:
> Hello,
>
> I am trying to run a for loop in the get function and keep encountering p=
roblems. Thanks in advance for help and suggestions to resolve this problem=
.. I created a GUI and have three editable textboxs taged text1, text2, and =
text3 and a push button taged pushbutton1. The code below is in pushbutton1=
function. Please find code and error message below.
>
> code:
>
> for b=3D 1:3
> =A0 =A0 target_temp_string(b) =3D get(handles.textb, 'String');
> end
>
> for c=3D 1:3
> =A0 =A0 target_temp_string(c)
> end
>
> error message:
>
> ??? Error using =3D=3D> struct2handle
> Undefined function or method 'test' for input arguments of type 'char'.
>
> ??? Error using =3D=3D> test('text3_CreateFcn',gcbo,[],guidata(gcbo))
> Error using =3D=3D> struct2handle
> Undefined function or method 'test' for input arguments of type 'char'.
>
> ??? Error using =3D=3D> struct2handle
> Error while evaluating uicontrol CreateFcn
>
> ??? Error using =3D=3D> struct2handle
> Undefined function or method 'test' for input arguments of type 'char'.
>
> ??? Error using =3D=3D> test('text2_CreateFcn',gcbo,[],guidata(gcbo))
> Error using =3D=3D> struct2handle
> Undefined function or method 'test' for input arguments of type 'char'.
>
> ??? Error using =3D=3D> struct2handle
> Error while evaluating uicontrol CreateFcn
>
> ??? Error using =3D=3D> struct2handle
> Undefined function or method 'test' for input arguments of type 'char'.
>
> ??? Error using =3D=3D> test('text1_CreateFcn',gcbo,[],guidata(gcbo))
> Error using =3D=3D> struct2handle
> Undefined function or method 'test' for input arguments of type 'char'.
>
> ??? Error using =3D=3D> struct2handle
> Error while evaluating uicontrol CreateFcn
>
> ??? Undefined function or method 'test' for input arguments of type 'char=
'.
>
> ??? Error using =3D=3D> test('pushbutton1_Callback',gcbo,[],guidata(gcbo)=
)
> Undefined function or method 'test' for input arguments of type 'char'.
>
> ??? Error while evaluating uicontrol Callback
Instead of get(handles.textb, 'String');
try:
get(handles.(sprintf('text%d',b)),'String');
-Nathan
|
|
0
|
|
|
|
Reply
|
Nathan
|
5/19/2010 9:52:05 PM
|
|
|
1 Replies
176 Views
(page loaded in 0.04 seconds)
Similiar Articles: Double "for" loop problem.. - comp.soft-sys.matlabI've triple-checked the function for D and all is well, so I can ... I'd also try to avoid those nested for loops, you could use something like the following: B1 = repmat(B ... unit step , ramp functions - comp.soft-sys.matlabhello am trying to create new unit step and unit ramp function using matlab language and use them to get a plot for a specific ... and you would then not need a loop to ... Add Data to a file during each iteration - comp.soft-sys.matlab ...I am trying to run a "for loop" to find the binary equivalent of decimal numbers. ... alldata(i,:)=bin %this one is not working for above function, altough I am able to use ... Creating a matrix using a for loop - comp.soft-sys.matlab ...hi, I'm trying to create a matrix of 8X12 by the code below but I get a matrix of 12X12. ... soft-sys.matlab ... hi everyone how can i use for loop function to ... Exponential Moving Average without For Loop - comp.soft-sys.matlab ...... calls for an initial EMA value.. how does the Filter function get ... soft-sys.matlab Exponential Moving Average without For Loop - comp.soft-sys.matlab ... Hello, I am trying ... Please help, how to use "for loop" to list out the coordinate ...Now i'm assigned to use >>for loop / for function<< to list the index of every max elements. ... Try replacing <10> with a variable name and examining the contents. If ... Error using ==> fprintf Function is not defined for 'sym' inputs ...Hello, I'm trying to output 3 points from a ... Below is the for loop I have created that I'm trying to run. ... Help with function and syms - comp.soft-sys ... calculate mean using for loop. . . . - comp.soft-sys.matlab ...hi everyone how can i use for loop function to calculate the individual mean from the following: matric size is [756 308], the increment between two ... Use MPI inside a for loop - comp.parallel.mpiHello all, I need to make below code MPI'ed. Inside the "for" loop, there are 2 calls to function "solve" which is very heavy. So I wanted to make us... Using nested for loops for Matrix multiplication - comp.soft-sys ...You've manually unrolled that third nested loop that you're trying to implement. ... I need to create a function only using loops ... Use nested loop to calculate average ... Nested Loop Functions in Excel | eHow.comMicrosoft Excel is a powerful application that offers many tools for analyzing and manipulating data. The formula engine in Excel is particularly versatile for ... Learning to Function and Loop - Web Site Development Tutorials ...Learning to Function and Loop. HTML is boringly static, it’s rigid, and, is least interactive. DHTML makes it dynamic and responsive. Now, DHTML is not another of ... 7/17/2012 3:37:47 AM
|