f



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
0
5/9/2011 5:14:05 AM
comp.soft-sys.matlab 211266 articles. 19 followers. lunamoonmoon (257) is leader. Post Follow

2 Replies
5423 Views

Similar Articles

[PageSpeed] 55

"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 have any hints?  Is there a new syntax?
> cheers,
> Mel
>

Hi Mel,

There is not change in syntax AFAIK - do you know that you are using the 
S-function exactly as it used to be. For example, are you using a different 
set of inputs now.

Have you tried setting a breakpoint at the offending line to see what the 
value of u(1)/u(2) is?

Kaustubha Govind 

0
kgovind (52)
5/10/2011 2:58:38 PM
On Monday, 9 May 2011 10:44:05 UTC+5:30, Mel Cutler  wrote:
> 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

you can try with "direct feed trough"
0
f.60mhz (2)
9/18/2012 7:49:09 PM
Reply:

Similar Artilces:

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...

Output returned by S-function 'xxx' in block xxx during flag=3 call must be a real vector of length x
Hi, I wrote a S-function which takes 4 inputs and 2 outputs.I defined the number of outputs and inputs under mdlinitializesizes as 4 and 2. And under mdloutputs, I wrote the following code: a=....using u(1).. b=....using u(2).. temparr=[a;b]; sys=temparr; and I'm getting an error message:" Output returned by S-function 'xxx' in block 'xxx'during flag=3 call must be a real vector of length 2. When searched for a soln, I found that this is a bug in malab and comes when no: of outputs is not equal to no: of inputs and gave a temporary solution like che...

It's on-it's off-it's on, it's off -WHY?
IS THIS THE CORRECT FORUM? Hope so. We have three computer networked at home...all with Windows XP. one of those is a laptop. Some mornings all 3 can see each other and transfer files...then mysteriously one or more will disappear. No contact....then later it's back. The laptop is the worst. Most often it won't let us in...but sometimes it will. No obvious reason. The most INFURIATING part is the message "see your administrator". Dammit Bill Gates...don't you realize that most networks are small offices without a Majestic Royal Administrator sitting his i...

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 dir...

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]'); ...

i wonder result's difference between 'solve function' and 'circcirc function'
i calculate intersection point between two circles. first way, i used solve function. second way, i used circcirc function. By the way two way result is similar. but, The result is the same five-digit decimal. i wonder result's difference between 'solve function' and 'circcirc function' five-digit decimal. >> five decimal places On 7/11/14 7:03 AM, 김영재 wrote: > i wonder result's difference between 'solve function' and 'circcirc function' solve is much more general. Try finding the intersections between y=x^3 and y=9*x us...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

Error? s = assignin('base','s',tf('s'));
Hi, I need a little help here. Could anyone please tell me what is wrong with this command? s = assignin('base','s',tf('s')); The matlab syntax is -- assignin(ws, 'var', val) Basically I just want to add s=tf('s') into the base workspace. Jack "Jack" <Jack@Jill.com> wrote in message news:ef3e449.-1@webcrossing.raydaftYaTP... > Hi, > I need a little help here. Could anyone please tell me what is wrong > with this command? > > s = assignin('base','s',tf('s')); > > The matlab syntax is -- as...

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'...

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...

error: must use '.*' or '->*' to call pointer-to-member function in '__unary_op (...)'
hi! a little compiler error. pls help. class A{ B get(unsigned int i);// return an B object whose state depend on *this and i std::vector<B> get_vec(){ std::vector<unsigned int> ints(n); iota(ints.begin(),ints.end(),0); std::vector<B> ret; transform( ints.begin(), ints.end(), back_inserter(ret), get//or &get, *this.*get etc... ); return ret; }; private: unsigned int n; } In function '_OutputIterator std::transform(_InputIterator, _InputIterator, _OutputIterator, _UnaryOperation) [with _InputIterator = __gnu_cxx::__normal_ite...

Prob getting '1's and '0's
Hi all =) I have a var named Data_Bin which is in <10614*8char> containing binary '1's and '0's. eg Data_Bin = 11111111 11111111 11111111 11111111 .... ... I tried 2 methods, Method 1: aa = []; for i=1:84912 aa = [aa, Data_Bin(i)]; end Result: It gave me a 1*1 matrix but if I transpose the result, it'll give me a col vector. Method 2: aa = []; for i=1:84912 aa (1, i) = Data_Bin(i); end Result: It gave me a row vector of [49 49 49 49 ...] How do I get a row vector, 1*84912, from Data_Bin?? Thank you. "yingmu h...

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 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 [] = call...

How to turn off 'N', 'S', 'E', 'W'
in the map lat and lon labels? I'm doing a final figure and I really don't need an 'N' after every latitude label, jus the number would suffice. How do I turn of the letters followin the number? What function / toolbox are you refering to?!? Being a little more specific would sure help to get an answer ... Sebastian ...

It's primitive; it's dumb; it's brittle--but it's AI.
http://www.scn.org/~mentifex/aisource.html is a pathway to the http://code.google.com/p/mindforth AI project at Google Code. The AI is primitive because it has only enough features to demon- strate thinking. It is "dumb" inasmuch as it has barely any IQ. It is extremely brittle because the slightest change in the code can destroy the artificial mind crafted so painstakingly in Forth: Arthur -- http://agi-roadmap.org/Milestones -- ten years of progress. ...

'is not' or '!='
A newbie question to you; what is the difference between statements like: if x is not None: and if x != None: Without any context, which one should be preferred? IMHO, the latter is more readable. On 2014-08-18 21:35, ElChino wrote: > A newbie question to you; what is the difference between statements > like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. > "x == y" tells you whether x and y refer to objects that are equal. "x is y&qu...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

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, n...

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, n...

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 ...

What return value should be besides '0' and '1' for this function?
Hi, I read the following code. I know that std_logic has value '0', '1', 'Z' and 'X' etc. There are only two values are considered below. Do you think it is an imperfect function or not? Thanks, FUNCTION to_integer( x : IN std_logic) RETURN integer IS VARIABLE int: integer; BEGIN IF x = '0' THEN int := 0; ELSE int := 1; END IF; RETURN int; END; On 5/22/2015 10:31 PM, fl wrote: > Hi, > > I read the following code. I know that std_logic has value '0', '1', ...

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@...

There's 'new' but no 'delete'
Hi, If I use: "myobject = new MyObject" do I just delete it with "myobject = nil"? There's no "delete", how do I free any memory used within myobject? Thanks, Paul On 15.04.2005 05:35 Mat, in 425e45ff$0$30370$afc38c87@news.optusnet.com.au, �pf� <paulfredlein@NOSPAMoptusnet.com.au> wrote: > Hi, > > If I use: "myobject = new MyObject" do I just delete it with "myobject = > nil"? There's no "delete", how do I free any memory used within myobject? > > Thanks, > > Paul ...

Which one(s) of the following std::vector's member functions has the possibility/authority to reduce the vector's capacity?
For C++11, I have 4 member functions in question: template <class T, class Allocator = allocator<T> > class vector { public: vector<T,Allocator>& operator=(const vector<T,Allocator>& x); vector<T,Allocator>& operator=(vector<T,Allocator>&& x); vector& operator=(initializer_list<T>); void clear() noexcept; }; For C++03, I have 2 member function in question: template <class T, class Allocator = allocator<T> > class vector { public: vector<T,Allocator>& operator=(const vector<...

Web resources about - Output returned by S-function 'xxxxxxx' in 'xxxxx/S-Function' during flag=3 call must be a real vector of length 1 - comp.soft-sys.matlab

Resources last updated: 2/25/2016 2:10:09 AM