I do some revisions to my equation but I still got no answer. It says that there is no enough input argument. Can someone please help me?
    5 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    John Marvin Miniano
 il 11 Mag 2022
  
    
    
    
    
    Commentato: Alex Sha
      
 il 11 Mag 2022
            function f=rle(x)
f(1)=x(2)+x(3)+x(5)+x(7)-2758.6474;
f(2)=2*x(1) + 2*x(4) + 4*x(5)-5684.5402;
f(3)=x(2) +2*x(3)+x(4)-4292.1525;  
f(4)=2*x(6)-6422.3564;
f(5)=((x(1)^3)*(x(2))/(x(4)*x(5)))-(1893.12055);
f(6)=(x(1)*x(3))/(x(2)*x(4))-(0.7631343);
f(7)=((x(1)*x(2))/x(4))-(32.200985); 
>> x0=[150;150;150;150;150;150;150];
x=fsolve(rle,x0);
Not enough input arguments.
Error in rle (line 2)
f(x)=x(2)+x(3)+x(5)+x(7)-2758.6474;
0 Commenti
Risposta accettata
  VBBV
      
      
 il 11 Mag 2022
        
      Modificato: VBBV
      
      
 il 11 Mag 2022
  
      x0=[150;150;150;150;150;150;150];
% x = 1:7; % give input vector to fucntion
sol=fsolve(@rle,x0)  % call the function using function handle 
plot(sol)
function f=rle(x)
f(1)=x(2)+x(3)+x(5)+x(7)-2758.6474;
f(2)=2*x(1) + 2*x(4) + 4*x(5)-5684.5402;
f(3)=x(2) +2*x(3)+x(4)-4292.1525;  
f(4)=2*x(6)-6422.3564;
f(5)=((x(1)^3)*(x(2))/(x(4)*x(5)))-(1893.12055);
f(6)=(x(1)*x(3))/(x(2)*x(4))-(0.7631343);
f(7)=((x(1)*x(2))/x(4))-(32.200985); 
end
1 Commento
  Alex Sha
      
 il 11 Mag 2022
				There are multi-solutions:
No.	 1	                 2
x1	-206.504477863007	191.355831175864
x2	-249.192353855846	236.471139659005
x3	1471.63884269976	1325.22038022388
x4	1598.06716845633	1405.24059989323
x5	725.353704703337	622.836834465451
x6	3211.1782	3211.1782
x7	810.847206452752	574.119045651664
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Function Creation in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
