how t o use equation coming out of solve function with an array

4 vues (au cours des 30 derniers jours)
hesha tany
hesha tany le 20 Août 2018
Modifié(e) : hesha tany le 24 Août 2018
I'm trying to put a simple array into a function and plot the values that comes out, i think it doesn't work cause the array size of the function that comes out is not equal to the array size of ti , im kinda new to matlab so sry if this is a noob question
syms toFx
syms ti
ti=1:1:20
toFx=solve(ti./toFx==13,toFx)
plot(ti,toFx)

Réponse acceptée

Walter Roberson
Walter Roberson le 20 Août 2018
ti=1:1:20
toFx=solve(ti./toFx==13,toFx)
is asking to find one single toFx that satisfies all 20 of the equations simultaneously.
syms toFx
syms ti
ti_vals=1:1:20
toFx=solve(ti./toFx==13,toFx)
plot(ti_vals, subs(toFx, ti, ti_vals))
  3 commentaires
Walter Roberson
Walter Roberson le 21 Août 2018
The main alternative would be to use a loop.
hesha tany
hesha tany le 24 Août 2018
Modifié(e) : hesha tany le 24 Août 2018
later i needed to use the main alternative so i went back here to check and found that u posted yet another solution to my problem , thanks :D

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Tags

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by