Effacer les filtres
Effacer les filtres

How to iterate and plot in matlab

2 vues (au cours des 30 derniers jours)
Marina Gonzalez
Marina Gonzalez le 10 Juin 2019
Commenté : darova le 15 Juin 2019
Hello! I need some help with Matlab.
I would like to solve and plot the following function:
I've called dxa/dW 'y', and I know everything except for xa, which I'd like to iterate from 0 to 1 in steps of 0.05. This is what I have written, but I am obviously doing something wrong because it gives me an error.
I would really apreciate it if you could help because I need it as soon as possible for my thesis.
Thank you in advance.

Réponse acceptée

Floris
Floris le 10 Juin 2019
Modifié(e) : Floris le 10 Juin 2019
Hello,
Maybe I misunderstand what you are attempting to do, so please let me know if you need any additional clarification. I notice you are varying x from 0 to 1, however, you do not seem to have the variable W in the equation where you define y. In order to plot W, you will need to map W using linspace() as well as X. Checkout the link below for help on what I think you are trying to do:
So I have the following code below:
x = linspace(0,1,200);
kw = 91371;
Ca0 = 1.81 * 10 ^ -4;
Fa0 = 0.1233;
K = 2;
y = (1/Fa0) * ((kw .* Ca0 .* (1 - x)) ./ (1 + K .* Ca0 .* (1 - x)))
plot(x, y);
  6 commentaires
Marina Gonzalez
Marina Gonzalez le 15 Juin 2019
Modifié(e) : Marina Gonzalez le 15 Juin 2019
How would I write it on Matlab to solve the expression you wrote and plot x vs W? Take into account that x should be values between 0 and 1.
darova
darova le 15 Juin 2019
read about int

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by