f



Function : Output argument "out" (and maybe others) not assigned during call to

My Principal function :
function [out] = Cf( t,x ) 

LAMBDA=0; %constante de décroissance du soluté
b=10^-3; %demi-largeur de la fente
Dm=10^-10; %%coefficient de diffusion dans la matrice
Vf=10^-5; %%vitesse d'advection dans la fente
Xc=10^-1; %%profondeur de fracture
Tc=Xc/Vf; %%temps advectif correspondant à la profondeur de fracture
Zc=sqrt(Dm*Tc); %%longueur de diffusion dans la matrice
%%nombres adimensionnels
beta=b/Zc;
%ZETA=z/Zc;

T=1; %%temps final adimensionné par Tc
nt=50;
dt=T/nt;
t=[0:dt:nt*dt];

X=1;
nx=100;
dx=X/nx;
x=[0:dx:nx*dx];

%%Advection dans la fente selon Ox
Cf=zeros(nt+1,nx+1);
   
 for i=1:nt+1
     for j=1:nx+1
     if(t(i)-x(j)>0) %%heaviside(t(i)-x(j))
 Cf(i,j)=0.5*exp(-0*t(i))*x(j)/beta/(pi*(t(i)-x(j))^1.5)*exp(-x(j)^2/4/beta^2/(t(i)-x(j)));
     end
     end
 end 

%%Tracé de Cf en fonction de x à des temps donnés :
Anim_cf_t=moviein(length(t));
for i=1:length(t)
   
    Anim_cf(i)=getframe;
    plot(x,Cf(i,:),'b')
    xlabel(i)
    axis([0 1.2 0 10]);
end

 %%Tracé de Cf en fonction du temps pour x donné :
 Anim_cf_x=moviein(length(x));
figure;
for k=1:length(x)
   
    Anim_cf(k)=getframe;
    plot(t,Cf(:,k),'r')
    xlabel(k)
    axis([0 1.2 0 10]);
end
end


My function :

function A = Cmax( t )
 x=0.001;
     while Cf(t,x)<=Cf(t,(x+0.001))
            x=x+0.001;
        end
        Cmaxi=Cf(t,x)
        Xmaxi=x
        A=zeros(1,2)
        A(1,1)=Cmaxi
        A(1,2)=Xmaxi   
end


When I run my function Cmax, I have this message and I don't understand where is my problem...

>> Cmax(15)
Error in ==> Cf at 3
LAMBDA=0; %constante de décroissance du soluté

??? Output argument "out" (and maybe others) not assigned during call to "C:\Users\Matthieu\Desktop\BE
MATLAB\Cf.m>Cf".

Error in ==> Cmax at 3
     while Cf(t,x)<=Cf(t,(x+0.001))


If someone can help me, Thanks
0
Matthieu
1/15/2011 12:49:05 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

1 Replies
7982 Views

Similar Articles

[PageSpeed] 42

On 15/01/11 6:49 AM, Matthieu wrote:
> My Principal function :
> function [out] = Cf( t,x )

In order to return a value from a function that way, the return value 
must be assigned to the variable you named on the left hand side ("out") 
and not to the name of the function ("Cf")
0
Think
1/15/2011 1:34:16 PM
Reply:

Similar Artilces:

error " Output argument "rate_match_output1" (and maybe others) not assigned during call to "C:\Users\USER\Documents\MATLAB\new_work\turbo1.m>turbo1".
my code is function [ Z_TOT,Z_TOT_INTR,rate_match_output,rate_match_output1,F] = turbo1( SEG_BLOCKS ) global c_min global c_max global k_min global k_max global block_size global filler_bits global F1 global F2 persistent rate1 persistent rate2 %% matrix of k from aseel code load turbo_intr %% calculation of f2 matrix load turbo_intr_2 %% matrix of f1 load turbo_intr_1 %i am trying to seperate blocks from SEG_BLOCKS MIN_BLOCKS=SEG_BLOCKS(1,(c_max*block_size(1)+1):end); for t=1:c_min N1=block_size(c_max+1); c1=MIN_BLOCKS(1,((t-1)*N1+1:(t*N1))); x_k1=c1; %% encode the message m1=0; % initial content of memory register equal zero m2=0; p=0; m3=0; z1=zeros(1,N1); for i=1:N1 % For N input bits b = xor(c1(i),m2); d = xor(b,m1); z1(i)=xor(d,p); m2=xor(m3,p); p=m3; m3=m1; % Content of memory register m1 shifting to m3 m1=b; end z1_tot(1,((t-1)*N1+1:(t*N1)))=z1; % the total output after encoder %% choose the value of f1 & f2 k1 = k_min; G=find(k1==turbo_intr); f1_value =turbo_intr_1(G); f2_value=turbo_intr_2(G); %% matrix after interleaver c_intr=zeros(1,N1); x=zeros(1,N1); for s=1:N1 x(s)=mod((f1_value*s + f2_value*(s^2)),k1 ); if x(s)==0 x(s)=s; end c_intr(s)=c1(x(s)); end ...

??? Output argument "r" (and maybe others) not assigned during call to "/home/mat/nonlinear_g.m>nonlinear_g".
Hi, I have been writing a code to solve a nonlinear system of waves and I am using the Newton -Raphson method to solve the system. I have a main program which computes the Jacobian and solves the linar system and I have a function which I discretise my system of equations. I get an odd error of: ??? Output argument "r" (and maybe others) not assigned during call to "/home/mat/nonlinear_g.m>nonlinear_g". My function that I have written is: function r=nonlinear_g(s,p,L,n,W) X=W(1:L); Y=W(L+1:2*L); u=W(2*L+1:3*L); v=W(3*L+1:4*L); E_x=W(4*L+1:5*L); E_y=W(5*L+1...

Error in get_Prefix (line 4) maskTmp = zeros(1,4); Output argument "prefix" (and maybe others) not assigned during call to "C:\Users\Suraj\Desktop\subfolder\get_Prefix.m>get_Prefix". Error in pr
function [prefix] = get_Prefix(inputIP,mask) maskTmp = zeros(1,4); for i=1:4 if mask >= 8 maskTmp(i) = 255; mask = mask-8; elseif mask ==0 maskTmp(i) = 0; else tmp=zeros(1,8); tmp(1:mask)=1; maskTmp(i) = sum(tmp.*2.^(numel(tmp)-1:-1:0)); mask=0; end end mask=maskTmp; numIP= convert_IP(inputIP); if numIP ~=-1 prefix = bitand(numIP,mask); prefix = convert_IP(prefix); end end ...

??? Output argument "r" (and maybe others) not assigned during call to
So here's my problem.. this is the code i type to use euler's 2nd order to numerically integrate the following equation, However, when i call the function with EulerMSM([0 8],0.2) in the command window, this error returns, Error in ==> EulerMSM>f_euler at 46 f_euler= -0.4*u - x - 0.5*x^3 +0.5*cos(0.5*t); ??? Output argument "maineqn" (and maybe others) not assigned during call to "c:\Program Files\MATLAB\R2009a\Euler\EulerMSM.m>f_euler". Error in ==> EulerMSM at 35 a(i) = f_euler(t(i),x(i),u(i)); The full program is as below and i've tried many things to solve this.. but still could not get it.. Any help is highly appreciated function EulerMSM(tspan,h) % EulerMSM(dydt,tspan,y0,h): % uses Euler's method to integrate an ODE % input: % dydt = name of the M-file that evaluates the ODE % tspan = [ti, tf] where ti and tf = initial and % final values of independent variable % y0 = initial value of dependent variable % h = step size % output: % t = vector of independent variable % y = vector of solution for dependent variable ti = tspan(1)+1; tf = tspan(2)+1; time = (ti:h:tf); N = length(time); % if necessary, add an additional value of t % so that range goes from t = ti to tf %declaring variables t = zeros(N+1,1); x = zeros(N+1,1); u = zeros(N+1,1); a = zeros(N+1,1); b = zeros(N+1,1); c = zeros(N+1,1); %initial Conditions t(1) = 0; x(1) = 0; u(1) = 0; ...

??? Error using ==> feval Output argument "x" (and maybe others) not assigned during call to
my function function [GCPV] = GCPV(Parray_stc,Htilt,fdirt,fmm,npv_inv,n_inv,ftemp) for i = 1:40 mod_code =i for j = 1:40 inv_code =j end end mod_database = xlsread('LIST_OF_MODULES.xls') inv_database = xlsread('LIST_OF_INVERTERS.xls') Pmodule_stc = mod_database(mod_code,3) Voc_stc = mod_database(mod_code,4) Vmp_stc = mod_database(mod_code,5) Isc_stc = mod_database(mod_code,6) Impp = mod_database(mod_code,7) fmm = mod_database(mod_code,8) Yvoc = mod_database(mod_code,9) Yvmp = mod_database(mod_code,10) Pnom_inv = inv_database(mod_code,3) Vmax_inv = inv_database(mod_code,4) Vmax_window_inv = inv_database(mod_code,5) Vmin_window_inv = inv_database(mod_code,6) Idc_inv = inv_database(mod_code,7) n_inv = inv_database(mod_code,8) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % SIZING INVERTER WITH PV ARRAY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % STEP 1 : calculate total module Ntotal_module1 = ceil ((Pnom_inv) ./ (0.8*Pmodule_stc)) %ceil is for round up Ntotal_module2 = floor ((Pnom_inv) ./ (0.75*Pmodule_stc)) %floor is for round down %Ntotal_module = [ Ntotal_module1, Ntotal_module2 ] % STEP 2 : calculate Vmax_oc, Vmax_mp and Vmin_mp Vmax_oc = Voc_stc.*(1-((Yvoc./100)*(20-25))) Vmax_mp = Vmp_stc.*(1-((Yvmp./100)*(20-25))) Vmin_mp = Vmp_stc.*(1-((Yvmp./100)*(75...

How do fix: "Wrong number of arguments" / "invalid propert assignment" / "Invalid argument"
I'm trying to view a web page. IE tells me there are (Java?) errors on the page. Here they are: Line: 15 Char: 7 Error: Wrong number of arguments or invalid propert assignment Code: 0 URL: http://(address.of.my.webcam):port/LiveView.html and Line: 46 Char: 3 Error: Invalid argument Code: 0 URL: http://(address.of.my.webcam):port/LiveView.html When it says "line 15" or "line 46" , is that really the 15'th and 46'th line of "liveview.html" ??? What is "Char" referring to? Here is the contents...

One or more output arguments not assigned during call to "movie"
Hello Matlab-world! I have this code ... figure(schleife); surf(bildgerastert) % surf(bild) colormap(gray) view(0,90) daspect([1 1 1]) xlabel('z-Achse'); ylabel('y-Achse'); grid off F(schleife) = getframe(gcf); saveas(schleife, strcat('J:\STICK\CODE\tomo\d_', int2str(schleife)), 'jpg'); close(figure(schleife)) toc end; % Schleife movie(F,5) movie2avi(movie(F),'tomo.mov') End in the end i get this error. ??? Error using ==> movie One or more output arguments not assigned during call to "movie". Could somebody help me please? Perhaps you have written your own 'movie.m' which has output argument. Hello Andrey No, there isnt such a file. :( I found the solution! wrong: movie2avi(movie(F),'tomo.mov') right: movie2avi(movie(F),'tomo.avi') ...

One or more output arguments not assigned during call to "set".
Hi I am using the following code to make some Radiobuttons mutually exclusive function radio_tilescan_callback(source,eventdata); val = get(source,'Value'); p = set(hRadioCellStack,'Value',abs(1-val)); end However, when I click the button to which this function is assigned as a callback I get the error: One or more output arguments not assigned during call to "set". When I remove the 'p =' there is no error message and val = 1 is displayed in the command window, However I would like to avoid having output b...

One or more output arguments not assigned during call to "varargout".
I googled this error message and can not even find one that exactly match the whole sentence, am I the only person who get the error? I use Matlab 2015b to run a simulation, and I got this error message randomly during 1 of multiple same simulations. My function is like the following: [varargout] = function MyFunction(var1, var2, varargin) output1 = [xxx]; output2 = [xxx]; output3 = [xxx]; ... varargout{1} = output1; if nvargin > 2 varargout{1} = output2, varargout{2} = output3; end end I got the following error: One or more output argument...

solution to ""ERROR: Output argument 'a' was not assigned during call to 'xlim'": Link to download xlim.m/ylim.m is not updated
Hi, I found technical solution to download new fixed xlim.m/ylim.m files in this adress: http://www.mathworks.com/support/solutions/en/data/1-19WWP/index.html?product=CO&solution=1-19WWP However they refering to a link to get the fixed files - but the link is not available any more. Do you know where I can download those files from? Thanks, Gilad "Gilad Asseraf" <gilad_asseraf@amat.com> wrote in message news:hsr9v6$333$1@fred.mathworks.com... > Hi, > I found technical solution to download new fixed xlim.m/ylim.m files in > this adress: &g...

One or more output arguments not assigned during call to "set". #2
i am doing image compression using LZW coding and i have got error like this Error in ==> imagecompr at 23 vector=set(0,'recursionlimit',2000); the error is present at while converting normalimage to lzw I1=rgb2gray(x); vector=set(0,'recursionlimit',2000); [vector, lzwTable] = norm2lzw(I1) if u find solution, please post the answer or the method On 10/18/2015 6:42 AM, chery/siddu wrote: > i am doing image compression using LZW coding and > i have got error like this Error in ==> imagecompr at 23 > vector=set(0,'recursionlimit',2000); &...

How override ALL function calls? (Is there a "function call function"?)
I'm trying run a homegrown profiler on some Python code. Rather than apply profiler wrapper to ALL functions by hand.... Is there a low level Python function I can override to modify how ALL functions are called? Chris seberino@spawar.navy.mil wrote: > I'm trying run a homegrown profiler on some Python code. > > Rather than apply profiler wrapper to ALL functions by hand.... > > Is there a low level Python function I can override to modify > > how ALL functions are called? Yes, please take a look at sys.setprofile(). Regards, Martin On 31 Jul 2005 12:01...

"""""""""ADD ME""""""""""
Hi , Hope you are doing great. Please let me take this opportunity to introduce myself, Iam Karthik working with BhanInfoi Inc, a NY based company. We have consultants on our bench on various technologies, my request is to add me to your distribution list and kindly do send me the requirements. i have the below list available 1. Mainframe 2. Java 3.. Financial Analyst 4. Data Architect If there is any vendor ship agreement which has to be signed then I would like to take an opportunity to represent my company and expect your cooperation... ...

Urgent Requirement in """""""""""""NEW YORK""""""""""""""""
Hello Partners, Please find the requirement below. Please send the updated resume along with rate and contact no. REQ#1: Title : Java Developer ( Rating Project) Duration : 6 months Rate : open Location : NY strong java, WebLogic 9.2, Web Services, Oracle REQ#2: Title : Java Developer Duration : 4 months Rate : open Location : NY Strong java, SQL REQ#3: Title : VB.Net Consultant Location : NY Duration : 4 months Rate : open Primarily looking at someone who has Excel, VB.net and Oracle (good to have). Req #4: Title : Java Developer (MSA Project) Duration : 6+ months Rate : open Location : NY Note : Please send your updated resume along with contact no karthik@bhaninfo.com : No phone calls please. Thanks & Regards Karthik BhanInfo karthik@bhaninfo.com ...

output argument "what ever"is not assigned
Hi, I have a little matlab problem. When I try to run my function I get following error: output argument "gridLd" is not assigned Does anyone sees the error? May function-codes is: function [cycleLd, cycleRd, cycleDk, cycleSoi, cycleMpi, cycleAgr]=ecu(cycleRpm, cycleTorque, rpm, torque, ldGrid, rdGrid, dkGrid, soiGrid, mpiGrid, agrGrid) lengthTorque=length(torque); lengthRpm=length(rpm); cycleLd = zeros(1,length(cycleLength)); cycleRd = cycleLd; cycleDk = cycleLd; cycleSoi = cycleLd; cycleMpi = cycleLd; cycleAgr = cycleLd; for i = 1:cycleLength [...

"my" and "our"
Hi, while testing a program, I erroneously declared the same variable twice within a block, the first time with "my", the second time with "our": { my $fz = 'VTX_Link'; .... ( around 200 lines of code, all in the same block) our $fz = 'VTX_Linkset'; ... } So the initial contents of the $fz declared with "my" is lost, because "our" creates a lexical alias for the global $fz, thus overwriting the previous "my" declaration. It was my error, no question. But I wonder why Perl doesn't mention this - even with "use s...

"If then; if then;" and "If then; if;"
I have a raw data set which is a hierarchical file: H 321 s. main st P Mary E 21 F P william m 23 M P Susan K 3 F H 324 S. Main St I use the folowing code to read the data to creat one observation per detail(P) record including hearder record(H): data test; infile 'C:\Documents and Settings\retain.txt'; retain Address; input type $1. @; if type='H' then input @3 Address $12.; if type='P' then input @3 Name $10. @13 Age 3. @16 Gender $1.; run; but the output is not what I want: 1 321 s. main H 2 321 s. main P Mary E 21 F 3 321 s...

"or" and "and"
Hi, I'm just getting to discover ruby, but I find it very nice programming language. I just still don't understand how the "or" and "and" in ruby... I was playing with ruby and for example made a def to print Stem and Leaf plot (for those who didn't have a statistics course or slept on it, e.g. http://cnx.org/content/m10157/latest/) Here is the Beta version of it: class Array def n ; self.size ; end def stem_and_leaf(st = 1) # if st != (2 or 5 or 10) then ; st = 1 ; end k = Hash.new(0) self.each {|x| k[x.to_f] += 1 } k = k.sort{|a, b| a[0].to_f <=&g...

"out" and "in out"
Hi i found the following explaination: In Ada, "in" parameters are similar to C++ const parameters. They are effectively read-only within the scope of the called subprogram. Ada "in out" parameters have a reliable initial value (that passed in from the calling subprogram) and may be modified within the scope of the called procedure. Ada "out" parameters have no reliable initial value, but are expected to be assigned a value within the called procedure. What does "have no reliable initial value" mean when considering the "out" parameter? By c...

"/a" is not "/a" ?
Hi everybody, while testing a module today I stumbled on something that I can work around but I don't quite understand. >>> a = "a" >>> b = "a" >>> a == b True >>> a is b True >>> c = "/a" >>> d = "/a" >>> c == d True # all good so far >>> c is d False # eeeeek! Why c and d point to two different objects with an identical string content rather than the same object? Manu Emanuele D'Arrigo wrote: >>>> c = "/a" >>>&...

why "::", not "."
Why does the method of modules use a dot, and the constants a double colon? e.g. Math::PI and Math.cos -- Posted via http://www.ruby-forum.com/. On Oct 26, 2010, at 01:48 , Oleg Igor wrote: > Why does the method of modules use a dot, and the constants a double > colon? > e.g. > Math::PI and Math.cos For the same reason why inner-classes/modules use double colon, because = they're constants and that's how you look up via constant namespace. Math::PI and ActiveRecord::Base are the same type of lookup... it is = just that Base is a module and PI is a float....

about "++" and "--"
why this program snippet display "8,7,7,8,-7,-8" the program is: main() { int i=8; printf("%d\n%d\n%d\n%d\n%d\n%d\n",++i,--i,i++,i--,-i++,-i--); } > why this program snippet display "8,7,7,8,-7,-8" Ask your compiler-vendor because this result is IMHO implementation-defined. Check this out: http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.15 http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.16 Regards, Irina Marudina fxc123@gmail.com wrote: > why this program snippet display "8,7,7,8,-7,-8&q...

"Runtime error" using functions with argument "interp"
Hi, My program gets "Runtime error" and breaks down when using functions with argument "interp", such as Tcl_SetObjResult, Tcl_ResetResult, Tcl_Eval. The detailed information is "Microsoft Runtime Library: This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for information." It have some .tcl scripts and a DLL which is compiled with MS VC++6.0. The DLL uses SendArp function to check the connection, and returns TCL_ERROR or TCL_OK to tcl script using Tcl_SetObjResult. It works well with W...

matlab error "Input argument "resol_y" is undefined"
dear all.. i keep getting this error >>??? Input argument "resol_y" is undefined<< and the the error was pointed to here: function [snake_pnts,e] = snake(pnts, alpha, beta, max_delta_x, resol_x, ... max_delta_y, resol_y, feat_img) if resol_y < 1; resol_y = 1; end; <<-- the error can anybody help me?i'm new actually in matlab world this is the to the sourcesode <http://cobweb.ecn.purdue.edu/~malcolm/interval/1995-017/snake.m> "fiza" <pja_usm@hotmail.com> wrote in message news:ef58f4a.-1@webcrossing.ra...

Web resources about - Function : Output argument "out" (and maybe others) not assigned during call to - comp.soft-sys.matlab

Resources last updated: 3/10/2016 7:21:34 PM