Multiple values of x what will be code
Show older comments
%it is just a example i want to know if there are multiple number of say x with other constant say a and b. Is it possible to plot graph between x and y. I am working with similar code that i wrote below but graph is not showing. Clc; Close all; Clear all; A=5; B=6; X=4,9,56,33 Y=(a+b)/x Plot (X,Y)
Accepted Answer
More Answers (1)
fred ssemwogerere
on 11 Feb 2020
While your question may not be so clear, from my understanding, you are trying to find a vector,"Y" from a vector of "X" values. Try this:
A=5; B=6; X=[4,9,56,33];
% your vector "Y". From this you can proceed with your plot
Y=arrayfun(@(z) (A+B)/z, X);
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!