i have been trying to solve a problem on dc series motor
the code i typed in my editor was as follows
%function [w]=speed(b0,w0,N)
%function [b]=current(b0,w0,N)
%for i = 1:N-1
%w(i+1)=[14.192*{(.1236*b(i)*b(i))-0.17}]+w(i);
%b(i+1)=[.05452*{40-(.1236*w(i)*b(i))-(7.2*b(i))}]+b(i);
%end
%plot(1:N,w)
%plot(1:N,b)
i defined bo w0 N in command window and then typed
[w]=speed(b0,w0,N)
i gt the error ??? Undefined function or method 'speed' for input arguments of type 'double'
please help..........
|
|
0
|
|
|
|
Reply
|
aditya
|
12/3/2009 6:00:09 PM |
|
aditya wrote:
> i have been trying to solve a problem on dc series motor
> the code i typed in my editor was as follows
> %function [w]=speed(b0,w0,N)
> %function [b]=current(b0,w0,N)
....
> i defined bo w0 N in command window and then typed
> [w]=speed(b0,w0,N)
> i gt the error ??? Undefined function or method 'speed' for
> input arguments of type 'double'
a) You put the % comment in front of each line defining the function
b) You gave no body content for the function speed if it wasn't a comment
c) ML looks for a file w/ the name of the function to resolve function
calls so you need to save the code for each of the two functions in
files named speed.m and current.m
Read the documentation in the "Getting Started" chapter/section on
Programming and m-files...
--
|
|
0
|
|
|
|
Reply
|
dpb
|
12/3/2009 6:55:34 PM
|
|
dpb <none@non.net> wrote in message <hf91js$gmq$1@news.eternal-september.org>...
> aditya wrote:
> > i have been trying to solve a problem on dc series motor
> > the code i typed in my editor was as follows
> > %function [w]=speed(b0,w0,N)
> > %function [b]=current(b0,w0,N)
> ...
> > i defined bo w0 N in command window and then typed
> > [w]=speed(b0,w0,N)
> > i gt the error ??? Undefined function or method 'speed' for
> > input arguments of type 'double'
>
> a) You put the % comment in front of each line defining the function
> b) You gave no body content for the function speed if it wasn't a comment
> c) ML looks for a file w/ the name of the function to resolve function
> calls so you need to save the code for each of the two functions in
> files named speed.m and current.m
>
> Read the documentation in the "Getting Started" chapter/section on
> Programming and m-files...
>
>the problem is that the two functions are interrelated and the second iteration of w(2) cannot proceed without the computation of both w(1) and b(1) in first iteration
hence i want to ask about the procedure to declare both interelated functions simultaneously.If i remove function current from the code ..how do i declare the second function current becoz both have to be in the iterations simultaneously..
please help urgent...btw % ws jt fr demo tht its written in editor..thnx in advance to ani1 who helps
|
|
0
|
|
|
|
Reply
|
aditya
|
12/3/2009 9:38:19 PM
|
|
aditya wrote:
....
> hence i want to ask about the procedure to declare both interelated
functions simultaneously.If i remove function current from the code
...how do i declare the second function current becoz both have to be in
the iterations simultaneously..
....
There's no such thing as "declared simultaneously" -- whichever function
is invoked runs and returns to its caller when it has run to completion.
If one of these needs to call the other, that's fine; there just has to
be some sort of logic to prevent an infinite loop such as a convergence
criterion or somesuch.
--
|
|
0
|
|
|
|
Reply
|
dpb
|
12/3/2009 9:44:53 PM
|
|
w(i+1)=2000[(0.05 (B(i)^2)) -1.5905]+w(i)
B(i+1)=166.67[-0.5 B(i) -0.05 w(i) B(i) +220]+B(i)
simple iterations jst wanna plot it ...can u suggest ani simpler way to solve this problem (preferably without function calling)
thnnx for help .........
|
|
0
|
|
|
|
Reply
|
xingsan01 (1)
|
12/3/2009 9:57:20 PM
|
|
w(i+1)=2000[(0.05 (B(i)^2)) -1.5905]+w(i)
B(i+1)=166.67[-0.5 B(i) -0.05 w(i) B(i) +220]+B(i)
simple iterations jst wanna plot it ...can u suggest ani simpler way to solve this problem (preferably without function calling)
thnnx for help .........
|
|
0
|
|
|
|
Reply
|
aditya
|
12/3/2009 10:12:03 PM
|
|
|
5 Replies
157 Views
(page loaded in 0.103 seconds)
Similiar Articles: storing iteration results when using for loop. - comp.soft-sys ...for A=0.1:0.1:0.4; % A is 0.1,0.2,0.3 and 0.4 i.e 4 loops or 4 times C=linspace(10,40,4);% D =linspace(0.1,0.1,4); % E = [1 1 1 1... ... for A=0.1:0.1:0 ... File Name for each iteration in for-loop - comp.soft-sys.matlab ...Hi everybody, i have a (stupid) question...the point is that working with a for loop i need to save a file in each iteration, and i was wondering ... set the number of iterations in Gaussian mixtures (using ...Hi! I'm trying to fit Gaussian mixture distributions with K components to the data in X using the Matalb function gmdistribution.fit(X,K). It work... iterative plotting: changing color/linestyle within a loop - comp ...Hi, I'm trying to perform iterative plotting while changing the color/linestyle within each iteration. Since the number of plots may vary I have cre... nonlinear newton raphson iteration code - comp.soft-sys.matlab ...dear friends =C4=B1 need nonlinear newton raphson iteration code in order to find the roots of the my equations. do you mind if you send me the... Add Data to a file during each iteration - comp.soft-sys.matlab ...Hi All; I am new to programming word. I am trying to run a "for loop" to find the binary equivalent of decimal numbers. I want to write the binary ... How to write a code for iteration process - comp.soft-sys.matlab ...I am required to use Matlab to write a code to calcuate a value from guessing its initial value, i.e. using iteration method to obtain a value. I a... Please Help with My Fixed Point Iteration Program - comp.soft-sys ...Please help with newton raphson method in matlab - comp.soft-sys ... Please Help with My Fixed Point Iteration Program - comp.soft-sys ... Please help with newton ... Plotting result for each iteration of a for loops - comp.soft-sys ...Hi everyone, I have created a simple for loop where the values of a number of variables are calculated at each iteration. Now I wish to plot these ... Saving data in for loop - comp.soft-sys.matlabAdd Data to a file during each iteration - comp.soft-sys.matlab ... Saving data in for loop - comp.soft-sys.matlab Add Data to a file during each iteration - comp.soft-sys ... Chapter 1 Iteration% introduced in the Iteration chapter of "Experiments in MATLAB". % You can run it by entering the command % % iteration_recap % % Better yet, enter Iteration in MATLAB. Please save me!? - Yahoo! AnswersBest Answer: I'm not familiar with the van der Pol equation, and even less familiar with your problem, so I can only offer possibilities. But I think they ... 7/24/2012 7:06:14 AM
|