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

조회 수: 4 (최근 30일)
hesha tany
hesha tany 2018년 8월 20일
편집: hesha tany 2018년 8월 24일
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)

채택된 답변

Walter Roberson
Walter Roberson 2018년 8월 20일
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
Walter Roberson
Walter Roberson 2018년 8월 21일
The main alternative would be to use a loop.
hesha tany
hesha tany 2018년 8월 24일
편집: hesha tany 2018년 8월 24일
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

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by