f



How to call a component's callback function in another component's callback function

How to call a component's callback function in another component's callback function? 
I want to call popup menu's call back function in push button's call back function. What should I do and how?

I will be grateful to you for you help!

Thank you,

Regards,

Ahmed
0
2/12/2009 11:38:02 PM
comp.soft-sys.matlab 211266 articles. 19 followers. lunamoonmoon (257) is leader. Post Follow

8 Replies
982 Views

Similar Articles

[PageSpeed] 44

Just call it like you would any other function.  The only thing you have to worry about is parsing arguments in the callback that is called from multiple sources.  This example illustrates the difference:



%---------------------------------------------------------------------------------------%
function [] = callgui()

figure('pos',[500 500 200 50],'menub','no')
S.pb1 = uicontrol('sty','pu','un','pix','pos',[10 10 85 30],'fonts',14,...
               'str','PUSH_1','call',{@pb1call});
S.pb2 = uicontrol('sty','pu','un','pix','pos',[105 10 85 30],'fonts',14,...
               'str','PUSH_2','call',{@pb2call});
set(gcf,'userd',S);
           
function [] = pb1call(varargin)
% callback for PUSH_1
S = get(gcf,'userd');
pb2call(S.pb1) % call the other button's callback.


function [] = pb2call(varargin)
% callback for PUSH_2
S = get(gcf,'userd');
if varargin{1} ~= S.pb1
    fprintf('\t\t%s%i%s\n','PUSH_2 called me with : ',numel(varargin),' arguments')
else
    fprintf('\t\t%s%i%s\n','PUSH_1 called me with : ',numel(varargin),' arguments')
end
%---------------------------------------------------------------------------------------%





P4J(h<KDTKO<JaZO@@<PZZZJHa<z@BGIC=QtGDCJ>Z< O<ZICJ=ZH>@Z<JF
0
spamanon (2437)
2/13/2009 4:20:02 AM
You can make it as common script:

....
function a_Callback(hObject, eventdata, handles)
common_script;

function mesf_Callback(hObject, eventdata, handles)
common_script;
....

In file common_script.m you write what to do.

-----------------------------------------
Maxim Vedenev, MATLAB Custom Programming
vedenev@ngs.ru
http://simulations.narod.ru/
0
2/13/2009 6:05:54 AM
Thank you very much! Actually I'm not much expereiced in MATLAB and I have tried to design GUI using drag-n-drop method and not actually by coding for UI components. 

The problem I'm facing is that I have one popup menu and a text box called 'Distance' and a push button called 'Plot' and plot to show plots. Each time I change the value in the Distance (textbox) I have to select the popup menu and only then plot updates when I press Plot (push button) i.e. only when the popup menu callback function is called. I want to access the list of the string values in the popup menu in pushbutton's callback function. What to do? Here is the code below if anybody can help me fixing it!

function varargout = SimulationGUI(varargin)
% SIMULATIONGUI M-file for SimulationGUI.fig
%      SIMULATIONGUI, by itself, creates a new SIMULATIONGUI or raises the existing
%      singleton*.
%
%      H = SIMULATIONGUI returns the handle to a new SIMULATIONGUI or the handle to
%      the existing singleton*.
%
%      SIMULATIONGUI('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in SIMULATIONGUI.M with the given input arguments.
%
%      SIMULATIONGUI('Property','Value',...) creates a new SIMULATIONGUI or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before SimulationGUI_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to SimulationGUI_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help SimulationGUI

% Last Modified by GUIDE v2.5 12-Feb-2009 23:39:03

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @SimulationGUI_OpeningFcn, ...
                   'gui_OutputFcn',  @SimulationGUI_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before SimulationGUI is made visible.
function SimulationGUI_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to SimulationGUI (see VARARGIN)
% Create the data to plot.
handles.membrane=membrane;
[x,y] = meshgrid(-8:.5:8);
r = sqrt(x.^2+y.^2) + eps;
sinc = sin(r)./r;
handles.sinc = sinc;
% Set the current data value.
handles.current_data = handles.sinc;
% Plot Surface Plot
surf(handles.current_data)
% Choose default command line output for SimulationGUI
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes SimulationGUI wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = SimulationGUI_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Display surf plot of the currently selected data.
surf(handles.current_data);

function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double


% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit3_Callback(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit3 as text
%        str2double(get(hObject,'String')) returns contents of edit3 as a double


% --- Executes during object creation, after setting all properties.
function edit3_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit4_Callback(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit4 as text
%        str2double(get(hObject,'String')) returns contents of edit4 as a double
% NewStrVal = get(hObject, 'String');
% NewVal = str2double(NewStrVal);
% handles.edit4 = NewVal;
% guidata(hObject, handles);


% --- Executes during object creation, after setting all properties.
function edit4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on selection change in popupmenu1.
function popupmenu1_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% Determine the selected data set.
str = get(hObject, 'String');
val = get(hObject,'Value');
handles.current_popup = str;
% Set current data to the selected data set.
switch str{val};
case 'Array Factor Pattern' % User selects peaks.
peakval = str2num(get(handles.edit1,'String'));
handles.current_data = peaks(peakval);
case 'Directivity Pattern' % User selects membrane.
handles.current_data = handles.membrane;
case 'Power Pattern' % User selects sinc.
handles.current_data = handles.sinc;
end
% Save the handles structure.
guidata(hObject,handles)
% Hints: contents = get(hObject,'String') returns popupmenu1 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu1


% --- Executes during object creation, after setting all properties.
function popupmenu1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: popupmenu controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on key press with focus on popupmenu1 and none of its controls.
function popupmenu1_KeyPressFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu1 (see GCBO)
% eventdata  structure with the following fields (see UICONTROL)
%	Key: name of the key that was pressed, in lower case
%	Character: character interpretation of the key(s) that was pressed
%	Modifier: name(s) of the modifier key(s) (i.e., control, shift) pressed
% handles    structure with handles and user data (see GUIDATA)
0
2/17/2009 11:39:01 PM
The gui below seems clear, but this question remains in my mind: how would one call the function programatically? Let's say I wanted a button push of button 2 to automatically force a button push of button 1? What would the set command look like to make this happen please?
thanks!
Andy

"Matt Fig" <spamanon@yahoo.com> wrote in message <gn2sdi$1cl$1@fred.mathworks.com>...
> Just call it like you would any other function.  The only thing you have to worry about is parsing arguments in the callback that is called from multiple sources.  This example illustrates the difference:
> 
> 
> 
> %---------------------------------------------------------------------------------------%
> function [] = callgui()
> 
> figure('pos',[500 500 200 50],'menub','no')
> S.pb1 = uicontrol('sty','pu','un','pix','pos',[10 10 85 30],'fonts',14,...
>                'str','PUSH_1','call',{@pb1call});
> S.pb2 = uicontrol('sty','pu','un','pix','pos',[105 10 85 30],'fonts',14,...
>                'str','PUSH_2','call',{@pb2call});
> set(gcf,'userd',S);
>            
> function [] = pb1call(varargin)
> % callback for PUSH_1
> S = get(gcf,'userd');
> pb2call(S.pb1) % call the other button's callback.
> 
> 
> function [] = pb2call(varargin)
> % callback for PUSH_2
> S = get(gcf,'userd');
> if varargin{1} ~= S.pb1
>     fprintf('\t\t%s%i%s\n','PUSH_2 called me with : ',numel(varargin),' arguments')
> else
>     fprintf('\t\t%s%i%s\n','PUSH_1 called me with : ',numel(varargin),' arguments')
> end
> %---------------------------------------------------------------------------------------%
> 
> 
> 
> 
> 
> P4J(h<KDTKO<JaZO@@<PZZZJHa<z@BGIC=QtGDCJ>Z< O<ZICJ=ZH>@Z<JF
0
3/16/2009 7:43:01 PM
Yes I am having a problem figuring this out as well. When I call a callback function from within another callback function, my handles structure isn't passed, even though I explicitly pass it to the function! Any other function works just fine, but callbacks seem funny in that regard.

For example:

Say I want to push a button, and have that button push another button (to keep from duplicating code).

I have:

funciton pushbutton1_Callback(hObject,eventdata,handles)
  % do something
  % set a value in the handles structure
  
   handles.keepthis=1;
   guidata(hObject,handles);  % Push the handles structure back to store it
  
   % now call the second pushbutton function.  

   pushbutton2(hObject,eventdata,handles)


function pushbutton2_Callback(hObject,eventdata,handles)
    % Display the variable

    disp(handles.keepthis)


------------------------------
OUTPUT
--------------------------------

? Non-existent variable handles.keepthis in pushbutton2_Callback line 1

See? I pass the handles structure to the second callback, after not only defining the variable in handles, but also sending it to the guidata function... but it still isn't there in the second callback. If I were running a function and not a GUI, this script would work perfectly. So what's the problem?


"Andy Daubenspeck" <andydot.daubenspeck@dartmouthdot.edu> wrote in message <gpma45$8uf$1@fred.mathworks.com>...
> The gui below seems clear, but this question remains in my mind: how would one call the function programatically? Let's say I wanted a button push of button 2 to automatically force a button push of button 1? What would the set command look like to make this happen please?
> thanks!
> Andy
0
3/26/2009 6:13:02 PM
I was having the same trouble for a long time.  Here is how I "handled" it: If, for example, I have edit text (edit2) always "refreshed" when I push button1, I update the handles structure of both callbacks via the following (generalized) way:

%-----Button 1 Callback-----
function [handles]=button1_Callback(hObject, eventdata, handles)
%Refresh the information contained in Edit Text 2
[handles] = edit2_Callback(hObject,eventdata,handles);
% Update handles structure
guidata(hObject, handles);

% snip...

%-----Edit Text 2 Callback-----
function [handles] = edit2_Callback(hObject, eventdata, handles)
input_text = get(handles.edit2,'String');
% Update handles structure
guidata(hObject, handles);

% :: end :: 

I think the key is to make sure each function and the calls to those functions have [handles] output and that input_text is always coming from edit2.  

There are probably better ways, but this worked for me.
0
marcreese (1)
7/1/2009 2:37:01 PM
 I am encountering the same problem. I am a total amateur in MATLAB programming. I have developed a GUI using the drag-drop method similar to our friend here. I also have a PUSH BUTTON "SHOW PLOT", and when I click on it, I want to have my plot in the axes-1, plot area. I have already developed the m-code for getting the plot. Can I call the m-file here so that when the push button is pressed I will have my plot displayed in the plot area which I have created using the drag drop method?

I will be thankful to who ever replies.
Thanks in advance!
0
10/29/2009 5:50:18 PM
"Soorya Srinivasan" <sooryasrinivasan@gmail.com> wrote in message <hcckkq$p4o$1@fred.mathworks.com>...
>  I am encountering the same problem. I am a total amateur in MATLAB programming. I have developed a GUI using the drag-drop method similar to our friend here. I also have a PUSH BUTTON "SHOW PLOT", and when I click on it, I want to have my plot in the axes-1, plot area. I have already developed the m-code for getting the plot. Can I call the m-file here so that when the push button is pressed I will have my plot displayed in the plot area which I have created using the drag drop method?
> 
> I will be thankful to who ever replies.
> Thanks in advance!

Try using the concept of OOPS of referencing. IF you have any doubt, let me know. If need some specific help, pls explain your problem in detail.
0
12/14/2009 1:26:01 PM
Reply:

Similar Artilces:

Error while obtaining sizes from MEX S-function 'forward' in block 'dummy/Dynamic_Model/S-Function'. MATLAB error message:.
Hi to everybody, I created the file forward.dll using the command: mex -DWIN32 -output forward model_d.c model_s.c sdlib.c assigns.c contact.c derivs.c gmc.c impact.c inits.c invert.c lcp_solver.c lmdif_c.c mathtools.c object.c output.c pipetools.c readmuscles.c readtools.c sdfor.c spring_based.c wrapping.c gcvspl.c user_def.lib forward.lib acpp.lib qhull.lib solid.lib wrap.lib I need to run the command: set_param([subsystemname,'/','S-Function'],'function name','forward','parameters','[0],[0],[0],[0],[0],[0],[1 0 0 0 20],[0]'); ...

Output returned by S-function 'xxxxxxx' in 'xxxxx/S-Function' during flag=3 call must be a real vector of length 1
Hi there, I've found several posts where people are experiencing this error "Output returned by S-function 'xxxxxxx' in 'xxxxxxx/S-Function' during flag=3 call must be a real vector of length 1" but I haven't been able to access a definitive solution. My m-files ran successfully with my previously installed version of Matlab/Simulink (i think V12 from 2000) but I've just upgraded to 2011a and now see this error. in InitializeSizes(u): sizes.NumOutputs = 1; sizes.NumInputs = 2; in Output(t,u): if u(2) == 0 u(2) = 1; end sys = u(1)/u(2); Does anyone have any hints? Is there a new syntax? cheers, Mel "Mel Cutler" <melcinasia@yahoo.co.nz> wrote in message news:iq7t6t$2ld$1@newscl01ah.mathworks.com... > Hi there, > > I've found several posts where people are experiencing this error > "Output returned by S-function 'xxxxxxx' in 'xxxxxxx/S-Function' during > flag=3 call must be a real vector of length 1" but I haven't been able to > access a definitive solution. > > My m-files ran successfully with my previously installed version of > Matlab/Simulink (i think V12 from 2000) but I've just upgraded to 2011a > and now see this error. > > in InitializeSizes(u): > sizes.NumOutputs = 1; > sizes.NumInputs = 2; > > in Output(t,u): > if u(2) == 0 > u(2) = 1; > end > sys = u(1)/u(2); > > Does anyone...

MatLab's 'movie' function
Hi! Using MatLab's 'movie' function you can play a movie recorded by the 'getframe' command. It is possible to specify the number of times the movie is played and the frames per second. Unfortunately, I've not found a way to stop the playback of a movie. Is it possible to, let's say I've specified the movie should be played 20 times, to disrupt the playback after an user interrupt?! Thanks a lot, Chris On Sat, 12 Feb 2005 10:40:06 +0100, Christoph ROLZ wrote: >Hi! > >Using MatLab's 'movie' function you can play a movie recorded by the >'getframe' command. It is possible to specify the number of times the >movie is played and the frames per second. > >Unfortunately, I've not found a way to stop the playback of a movie. > >Is it possible to, let's say I've specified the movie should be played >20 times, to disrupt the playback after an user interrupt?! > >Thanks a lot, > Chris if you want to play the movie, tried thi command index is the number of frame in video file. index = 1:100 mov = aviread('filename',index) for i = 1: 100 frame = mov(i).cdata; imshow(frame) end Please try it. ...

Matlab's 'graycomatrix' function
I have one question: Is Matlab's 'graycomatrix' function actually in accordance with original Haralick's 1973 paper? I mean, are they supposed to be the same algorithm? If yes, I don't think Matlab did a good job on this. For example, try it on this matrix (i.e., 'image'): 0 0 1 1 0 0 1 1 0 2 2 2 2 2 3 3 This matrix is in Haralick's original paper and the results can be compared. Can anybody ellaborate if you used it? Thank you. "Bulent Bayraktar" <bayrakta@purdue.edu> writes: > I have one question: Is Matlab's 'graycomatrix' function actually in > accordance with original Haralick's 1973 paper? > I mean, are they supposed to be the same algorithm? If yes, I don't > think Matlab did a good job on this. > > For example, try it on this matrix (i.e., 'image'): > 0 0 1 1 > 0 0 1 1 > 0 2 2 2 > 2 2 3 3 > > This matrix is in Haralick's original paper and the results can be > compared. > > Can anybody ellaborate if you used it? You do need to understand a bit about the conventions used in the software you are using. For example, the Image Processing Toolbox's default black-to-white range for double-precision inputs is [0, 1]. The reference page for graycomatrix describes in detail what it does. By default, for example, it quantizes the range [0, 1] into 8 levels, resulting in an 8-by-8 co-occurrence matrix. But for your matrix, it is seeing 5 &qu...

How to add the solver's option in Simulink's s-function
I have a system described in differential equations and I have include the options in the differential equation solving, and I incorporated it in the s-function block and put it in the Simulink. Here are my options and ode solver options = odeset ('Mass',@xu_mass,'MassSingular','yes','MStateDependence','strong'); % odeset('MaxStep','1e-3'); % odeset('RelTol',1e-3,'AbsTol',1e-3); domain = 0:1e-4:8; [t,y]=ode23(@xu_eq,domain,[0;zeros(7,1)],options); However, I don't know where to add the options to the simulation. Please help. Thanks in advance! On 2=D4=C27=C8=D5, =C9=CF=CE=E710=CA=B120=B7=D6, workaholic <liua...@gmail.= com> wrote: > I have a system described in differential equations and I have include > the options in the differential equation solving, and I incorporated > it in the s-function block and put it in the Simulink. > > Here are my options and ode solver > options =3D odeset > ('Mass',@xu_mass,'MassSingular','yes','MStateDependence','strong'); > % odeset('MaxStep','1e-3'); > > % odeset('RelTol',1e-3,'AbsTol',1e-3); > domain =3D 0:1e-4:8; > [t,y]=3Dode23(@xu_eq,domain,[0;zeros(7,1)],options); > > However, I don't know where to add the options to the simulation. > Please help. > > Thanks in advance! Is there anyone who met such a problem? Thanks again in...

State derivatives returned by S-function 'XX' in 'XXX' during flag=1 call must be a real vector of length 6
im using a s-function to build a motor model. there are 3 inputs,6 State derivatives and 6 outputs. the simulation diagnostics point out "State derivatives returned by S-function 'XX' in 'XXX' during flag=1 call must be a real vector of length 6" .who can tell me which kind of mistake possiblely i made? im going to be mad~~~ @.@ thx! "dumpoing001 " <yuxiao1224@hotmail.com> wrote in message news:ilc5ts$fvg$1@fred.mathworks.com... > im using a s-function to build a motor model. > there are 3 inputs,6 State derivatives and 6 outputs. > the si...

Invalid call from '~PRES8' function to 'REQ8' function main
Hi. I have a test program that is shipped with an evaluation board with a ARM 920T based micro on it. I use the ARM Realview to compile. The .C code compiles well, but when linking I get this error message: 2410init.o(Init) contains invalid call from '~PRES8' function to 'REQ8' function main I found on the ARM site that it is possible to make a warning of this error, but they don't say how. I also don't know why I get this error message. Does someone know the answer? Thanks in advance. Jeroen Nobody? "J. Taverne" <jeroentaverne@hotmail.com> wrote in message news:bihnhm$2ovr$1@beast.euro.net... > Hi. > > I have a test program that is shipped with an evaluation board with a ARM > 920T based micro on it. I use the ARM Realview to compile. The .C code > compiles well, but when linking I get this error message: > > 2410init.o(Init) contains invalid call from '~PRES8' function to 'REQ8' > function main > > I found on the ARM site that it is possible to make a warning of this error, > but they don't say how. I also don't know why I get this error message. Does > someone know the answer? > > Thanks in advance. > > Jeroen > > "J. Taverne" wrote: > I found on the ARM site that it is possible to make a warning of this error, > but they don't say how. I also don't know why I get this error...

what's the vbscript's cint() function in javascript
I have the following function to get the total qty: function calttl() { var ttlqty ttlqty=0 for (i = 0; i <= document.qtymain.orderdetail.length-1; i++) { ttlqty = ttlqty + document.qtymain.qty.item(i).value } } The problem I have is the document.qtymain.qty.item(i).value I get look like a string, so the number I get for ttlqty is not add up the number but concatenate. How do I convert the value I get to a number in javascript? Thanks for any help in advance. Amy ajiwu@elario.com (amy) writes: > The problem I have is the document.qtymain.qty.item(i).value I get > look like a string, so the number I get for ttlqty is not add up the > number but concatenate. <URL:http://jibbering.com/faq/#FAQ4_21> /L -- Lasse Reichstein Nielsen - lrn@hotpop.com Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html> 'Faith without judgement merely degrades the spirit divine.' amy wrote on 16 okt 2003 in comp.lang.javascript: > ttlqty = ttlqty + document.qtymain.qty.item(i).value > document.qtymain.qty.item[i].value I suspect. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) "Evertjan." <exjxw.hannivoort@interxnl.net> writes: > amy wrote on 16 okt 2003 in comp.lang.javascript: > > > ttlqty = ttlqty + document.qtymain.qty.item(i).value > > > > document.qtymain.qty.item[i].value > > I suspect. Probably not. It sound...

calling '!' or 'system' in matlab different than same functions from shell
Hi everyone, When I am in the shell (tcsh) on my Mac (outside Matlab), I am able to use the command line utility ncdump to read netcdf format files (http://www.unidata.ucar.edu/software/netcdf/): ncdump -h testfile.nc However, in Matlab, the same command preceded by the '!' (or using 'system') generates an error: >> !ncdump -h test.nc dyld: Library not loaded: /opt/local/lib/libnetcdf.7.dylib Referenced from: /opt/local/bin/ncdump Reason: Incompatible library version: ncdump requires version 10.0.0 or later, but libnetcdf.7.dylib provides version ...

for Frederic the pool's upper, with me it's easy, whereas within you it's calling handsome
Some hot code or stable, and she'll wickedly irritate everybody. She wants to dream weak elbows in Jimmie's desert. Both cooking now, Thomas and Kirsten wandered the bizarre satellites inside sad painter. No trees will be bad elder cases. Will you arrive between the hill, if Steven fully helps the unit? You finally pull pathetic and solves our lower, clever twigs towards a hallway. Where will we tease after Norbert attacks the hollow stadium's tyrant? Otto, in back of wrinkles good and active, climbs on it, departing subtly. I am partly bitter, so I scold you. W...

What is 'sensor's filter function'?
I am trying to perform the atmospheric correction of an ALI image with ENVI FLAASH addon. FLAASH doesn't recognize this sensor, therefore I have to set the sensor type to "Unknown MSI" and enter its characteristics manually. It requires "Filter Function File", which is used to define the sensor's spectral response. I have found ALI spectral response functions. How are these functions related to the "filter function"? Are they the same? On Aug 29, 11:50 am, wl2...@yandex.ru wrote: > ... > Are they the same? ------ YES ...

Calling a callback function from another callback in the same Matlab GUI
Hello, this is my first post here although I have found these pages hugely helpful over the last few years :) Some background: I have a GUI which allows the user to select one of 6 parameters (from the drop down menu) to plot, and one of several data files to use to compute values for the chosen parameter. I need the callback which chooses the data file to be able to call the callback of the parameter selector, as that callback chooses the part of the data file that we need to use for the selected parameter. If I simply call SelectParam_Callback(h.SelectParam, [], h); inside th...

calling rhapsody API's from s-functions
hi, i want to integrate simulink and rhapsody tools. For that i need to call APIs in the rhapsody from a s-function. i do not know which DLLs contains the APIs. But i have a Type library file(rhapsody.tlb) which contains the information about the APIs and their declarations. i have the code to call rhapsody APIs from VC++ by importing rhpsody.tlb file. How can i do that in simulink s-function. ...

How to use a class's member function in STL's algorithm?
We know that alomost every algorithm function, such as for_each, find_if, use funcional as well as function pointer. But when I want to use another class's member function, how could I do? See example: class TestPrint { public: TestPrint( int i ) { start_num = i; } void print( int i ) { cout << endl<< "| " << i + start_num << " |" << endl; } private: int start_num; }; int main() { TestPrint* pTest = new TestPrint( 8 ); int a[10] = {0, 1, 2, 3...

Python's __getattr__, Perl's autoload, Ruby's method_missing, and Smalltalk's #doesNotUnderstand
I'm still new here, and I just completed reading CLTL's documentation on packages and On Lisp's documentation on CLOS. It doesn't appear that Lisp has the equivalent of Python's __getattr__, Perl's autoload, Ruby's method_missing, and Smalltalk's #doesNotUnderstand. That is, there is no way I can do this (without new-function being defined): (new-function) and have it call some other function like this: (missing-symbol 'new-function) whose returning value will be evaluated as the value of new-function. Or did I miss something? Jonathan Gardner <...

1 to 20 with x number of 1's, 2's, 3's, ... 20's
This is probably a simple thing to do, so perhaps someone would send me in the right direction. I need to generate a list containing numbers from 1 to 20, say. But I cant just use A = 1:20, for example, because that provides me only one instance of each of the values. What I need is X instances for each value. For example, 5 ones, twos, threes, and so forth. Is there a simple command for this? Regards, Ulrik. On Sep 9, 10:52=A0am, "Ulrik Nash" <u...@sam.sdu.dk> wrote: > This is probably a simple thing to do, so perhaps someone would send me i= n the right direction. > > I need to generate a list containing numbers from 1 to 20, say. But I can= t just use A =3D 1:20, for example, because that provides me only one insta= nce of each of the values. What I need is X instances for each value. For e= xample, 5 ones, twos, threes, and so forth. > > Is there a simple command for this? > > Regards, > > Ulrik. x=3D5; %for example desiredlist=3Dreshape(ones(x,1)*[1:20],1,20*x) hth, suresh "Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <i6aaol$pvr$1@fred.mathworks.com>... > This is probably a simple thing to do, so perhaps someone would send me in the right direction. > > I need to generate a list containing numbers from 1 to 20, say. But I cant just use A = 1:20, for example, because that provides me only one instance of each of the values. What I need is X instances for e...

equivalent of IDL's 'execute' function?
In IDL there is a function: execute(mystring) which will execute whatever command is contained within the string 'mystring'. This is very helpful, for example, when you are reading a file which has a list of variable names and associated data values. You would like to create MATLAB variables with the names listed in the file and assign the data values to these (initially unknown) variable names. Is there any way to do this in MATLAB? For this example, 'mystring' would be defined by something like: mystring=strcat(varname,'=data_array') Emily Riddle wrote: > > > In IDL there is a function: > > execute(mystring) > which will execute whatever command is contained within the string > 'mystring'. > > This is very helpful, for example, when you are reading a file > which > has a list of variable names and associated data values. You would > like to create MATLAB variables with the names listed in the file > and > assign the data values to these (initially unknown) variable names. > > Is there any way to do this in MATLAB? > > For this example, 'mystring' would be defined by something like: > > mystring=strcat(varname,'=data_array') See help eval /PB Perfect. Thanks! PB wrote: > > > Emily Riddle wrote: >> >> >> In IDL there is a function: >> >> execute(mystring) >> which will execute whatever command is contained within th...

S-function 'MCK3' in 'test_dynamics1/Numerical Model1' has continuous states, but doesn't have a mdlDerivatives routine.
Dear All, When trying to simulate simulink model that contains an S-Function ...I get the following error message: S-function 'filename.c' has continuous states, but doesn't have a mdlDerivatives routine. Also, compiling the s-function I do not get a .dll file but .mexw32 file does this mean that it has nto been compiled? Thanks ...

Nvidia's 'Nalu' vs ATI's 'Ruby'
http://karpo.org/images/Dunno/Ruby.jpg Nvidia's GeForce 6800 (NV40) 'Nalu' demo consists of 300,000 polygons. very very impressive shit! ATI's Radeon X800 (R420) 'Ruby' demo consists of only 80,000 polygons. however it is also rendering a background with other elements. closer to what would be in an actual game. now, console gamers: keep in mind, whatever ATI has been able to come up with at this point (re: the R420 / Radeon X800) is a stepping stone to what they'll be able to have in 2005 for Xbox Next, and in 2006 for GCNext :) On 14 Apr 2004 21:33:15 -0700, nvidianv55@mail.com (NV55) wrote: >http://karpo.org/images/Dunno/Ruby.jpg > >Nvidia's GeForce 6800 (NV40) 'Nalu' demo consists of 300,000 polygons. >very very impressive shit! > >ATI's Radeon X800 (R420) 'Ruby' demo consists of only 80,000 polygons. >however it is also rendering a background with other elements. closer >to what would be in an actual game. > >now, console gamers: keep in mind, whatever ATI has been able to come >up with at this point (re: the R420 / Radeon X800) is a stepping stone >to what they'll be able to have in 2005 for Xbox Next, and in 2006 for >GCNext :) Wow............. I am impressed !! Must ask for an advanced payment of my Social Security to buy these consoles. Both should sink like rocks if not 100%backward compatible with existing non-Next software. Also, a huge marketing problem for n...

ndefined function or variable 'y'. The first assignment to a local variable determines its class. Function 'Embedded MATLAB Function' (#52.384.385), line 19, column 2: "y"
Hi everybody I have a serious problem and i need your help. i use embedded matlab function in simulink to generate some matrices which i use as input to other bloc on simulink. But i got this error while the simulation is running: Undefined function or variable 'y'. The first assignment to a local variable determines its class. Function 'Embedded MATLAB Function' (#52.384.385), line 19, column 2: "y" My code is function y = fcn(u) Ap=[0.9580 0 0 0;0 0.9418 0 0;0 0 0.9048 0;0 0 0 0.9277]; Bp=[0.25 0;0.25 0;0 0.5;0 0.5]; Cp=[0.1678 0 0.9516 0;0 0.2329 0 0.2890]; [m1,n1]=size(Cp); [n1,n_in]=size(Bp); A_e=eye(n1+m1,n1+m1); A_e(1:n1,1:n1)=Ap; A_e(n1+1:n1+m1,1:n1)=Cp*Ap; B_e=zeros(n1+m1,n_in); B_e(1:n1,:)=Bp; B_e(n1+1:n1+m1,:)=Cp*Bp; C_e=zeros(m1,n1+m1); C_e(:,n1+1:n1+m1)=eye(m1,m1); y(1:m1,:)=C_e; for kk=1:u-1; y((m1*kk)+1:m1*(kk+1),:)=y(m1*(kk-1)+1:m1*kk,:)*A_e; end thank you so much On 07/16/2014 5:50 AM, AGUEMON wrote: .... .... > ...i got this error while the simulation is > running: > > Undefined function or variable 'y'. The first assignment to a local > variable determines its class. > Function 'Embedded MATLAB Function' (#52.384.385), line 19, column 2: > "y" > .... > C_e(:,n1+1:n1+m1)=eye(m1,m1); > y(1:m1,:)=C_e; > > for kk=1:u-1; > y((m1*kk)+1:m1*(kk+1),:)=y(m1*(kk-1)+1:m1*kk,:)*A_e; .... Never used the em...

Postgresql equivalent for MySQL's 'rollup' function?
I'm beginning to move a very simple set of php scripts from MySQL to Postgresql and want to know if Postgresql has anything like MySQL's rollup function. I use several scripts that pull out time and dollar data, break it out by time period and have a total at the bottom. Anything like that? I haven't stumbled across anything yet. thanks, r rloef@interfold.com wrote: > I'm beginning to move a very simple set of php scripts from MySQL to > Postgresql and want to know if Postgresql has anything like MySQL's > rollup function. I use several scripts that pull out time and dollar > data, break it out by time period and have a total at the bottom. > Anything like that? I haven't stumbled across anything yet. > > thanks, > > r > I'm not an expert of MySQL, but the documentation says that the "WITH ROLLUP modifier" of the GROUP BY clause in the SELECT statement gives you the kind of query result you described, that should be: 1999 $1500 2000 $1400 2001 $100 (Total) $3000 In PostgreSQL you could do this by using a UNION between 2 queries. Consider this: CREATE TABLE public.sales ( year varchar(4), --other fields, for example product name, customer code, ... price float4 --money is deprecated. For more precision, you should use NUMERIC ); (Now, insert some data...) And run the following query: SELECT year, SUM(price) FROM sales ...

JSP, Servlet's, EJB's, Bean's?
I am currently developing an application where I call command line programs and capture the output. This is fine. What I am doing is creating a web interface for these programs using JSP/Servlets. What I would like to do is be able to call these programs. Using buttons or something, and dumping the output into a text area. I have a servlet that I generates the output that I need. My question is How do I get that output into the textarea? When I call a new function I want to be able to append the text to the end of the text area. I was told in another group that I would need a...

Slant-Eyed Asian Gooks, for Franklin the ticket's good, near me it's sweet, whereas on you it's calling unique, Detestable Greek Cowboy.
We depart them, then we furiously lift Julie and Claude's young powder. We tease them, then we wrongly solve Jay and Robert's difficult onion. It will dine durable boats, do you taste them? He will learn light poultices against the bitter full kiosk, whilst Endora eventually calls them too. Steve, still climbing, calls almost crudely, as the disk combs under their wrinkle. To be upper or outer will walk sharp painters to strangely laugh. Try walking the station's strange ointment and Jonnie will grasp you! Who walks firmly, when Ronnie loves the durable bowl to the monument? If you will care Jay's planet beneath forks, it will wanly dine the pen. Are you outer, I mean, changing for fat buttons? ...

Dr. Dobb's | It's Time to Get Good at Functional Programming | 12 3, 2008
Dr. Dobb's recently published the following introductory survey article on functional programmiing: Dr. Dobb's | It's Time to Get Good at Functional Programming | 12 3, 2008 http://www.ddj.com/development-tools/212201710;jsessionid=3MQLTTYJRPL3CQSNDLRSKH0CJUNN2JVN In particular, Scala, F#, Erlang, Haskell, and Mathematica are discussed in some detail, and OCaML is mentioned in passing. Unfortunately, the article does not mention some of the more significant programming languages (e.g., Scheme is not mentioned at all), tends to overgeneralize (e.g., it describes Haskell as "a foundation for research" without citing the recent "Real World Haskell" publication), and is inconsistent in some places (e.g., it describes Erlang as "a general-purpose language," but then, in the very same sentence, proceeds to describe it as being "specifically designed ... for building highly parallel, distributed, fault-tolerant systems"). Further, the article commits a number of significant factual errors. In particular, on the first page, the articles states that, >"In any functional programming language, you are likely to encounter these features: > >... > * Heavy use of pattern matching, although technically it is not a defining feature of FP. > * Lazy evaluation, which makes possible the creation of infinite sequences and other data structures." Pattern matching is not a standard feature of a number of maj...

Web resources about - How to call a component's callback function in another component's callback function - comp.soft-sys.matlab

Resources last updated: 3/27/2016 7:03:12 PM