Forum     

Go Back   Digit Technology Discussion Forum > Software > Software Q&A
Register FAQ Calendar Mark Forums Read

Software Q&A Having trouble with software? Find solutions here

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 17-10-2005, 11:23 PM   #1 (permalink)
I am Optimus Prime
 
navjotjsingh's Avatar
 
Join Date: Feb 2005
Location: Delhi, India
Posts: 1,919
Default A Simple Matlab Query

I made a function file in MATLAB 6.5 - compound.m as

Code:
function [captial,interest] = compound(capital,years,rate,timescomp);
% COMPOUND: function to compute the compounded capital and the interest
% call syntax:
%          [capital,interest] = compound(capital,years,rate,timescomp);
% ------------
x0 = capital; n = years; r = rate; k = timescomp;
if r>1
    disp('check your interest rate. For 8% enter .08 not 8.')
end
capital = x0*(1+r/k)^(k*n);
interest = capital - x0;
I now called the function as

Code:
>> [c,in]=compound(1000,5,0.06,4);
[color=red]??? One or more output arguments not assigned during call to 'compound'.[/color]
Can somebody tell me the reason for error and how should i rectify it?
navjotjsingh is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 18-10-2005, 03:10 PM   #2 (permalink)
144
Broken In
 
144's Avatar
 
Join Date: Sep 2004
Location: classified
Posts: 178
Default

Code:
function [captial,interest] = compound(capital,years,rate,timescomp);
See this line , You have mis-spelled 'capital'... you have typed 'captial' instead of 'capital'
144 is offline  
Old 18-10-2005, 04:27 PM   #3 (permalink)
I am Optimus Prime
 
navjotjsingh's Avatar
 
Join Date: Feb 2005
Location: Delhi, India
Posts: 1,919
Default

Thanks a lot. Why I could not figure it out? I am so stupid!
navjotjsingh is offline  
Old 20-10-2005, 01:08 PM   #4 (permalink)
champ_rock
 
champ_rock's Avatar
 
Join Date: Jun 2005
Location: Somewhere on the earth , near the equator
Posts: 751
Default

whats matlab for????? for what is it used
__________________
-------------
Registered Linux user number 400618
champ_rock is offline  
Old 20-10-2005, 05:32 PM   #5 (permalink)
I am Optimus Prime
 
navjotjsingh's Avatar
 
Join Date: Feb 2005
Location: Delhi, India
Posts: 1,919
Default

Matlab is used for doing complex mathematical calculation. More about matlab at www.matlab.com or www.mathworks.com
navjotjsingh is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +5.5. The time now is 02:07 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2