why am I getting the error Incorrect Number or Types of Inputs or Outputs for Function

J
Joshua · Apr 10, 2023 · 2K views
Question
my code is; syms d; s=solve('7*d + 3*e=71','d + 2*e=20'); s=[s.d s.e]; disp('1 dollar = '); s(1) disp('Eullar'); I am getting the error:   Incorrect number or types of inputs or outputs for function 'solve'.   Error in HW10 (line 2) s=solve('7*d + 3*e=71','d + 2*e=20'); The qustion I am solving is: "Seven dollars and 3 Euros make 71 Eullars. One dollar and 2 Euros make 20 Eullars. find out the value of a dollar in terms of Eullars"  
Expert Answer
Profile picture of Prashant Kumar
Prashant Kumar PhD Expert
Answered Oct 1, 2026

For equality inside a symbolic expression, use double equal signs (==) —

 

syms d e 
s=solve(7*d + 3*e == 71,d + 2*e == 20);
s=[s.d s.e];
disp('1 dollar = ');
1 dollar = 
vpa(s(1),3)
ans = 7.45
disp('Eullar');
Eullar

The ability to use character arrays has been removed (depricated). Although ‘e’ was not included in the syms call, I assume it is a variable and not the exponential function e that is the exp function. If it should be ‘exp(1)’ (or the exponential function of some other argument), make the appropriate changes in your code.

100% Run Guarantee 3-Hour Fast-Track Delivery

Need a Custom Version or Complete Simulation for This Problem?

Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.

Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!