I want to know the value of x for each value of V

조회 수: 4 (최근 30일)
Pablo Zarco
Pablo Zarco 2021년 2월 10일
댓글: Cris LaPierre 2021년 2월 10일
V=[2,4,5,6,7]
for i=1:numel(V)
x(i)=(2+4*7+8-9*6+x(i))/(3+4*6*V(i)+3*x(i))
end
  댓글 수: 2
the cyclist
the cyclist 2021년 2월 10일
Can you please use more than one sentence to describe what you are trying to do? You have not given enough information for us to help you.
Pablo Zarco
Pablo Zarco 2021년 2월 10일
Is an equation with one variable. The thing is that I would like to know if there is a way to solve this without clearing the x

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2021년 2월 10일
편집: Cris LaPierre 2021년 2월 10일
You are using x to calculate x. This is causing an error since x doesn't exist yet.
What is the equation you are trying to implement in MATLAB?
  댓글 수: 2
Pablo Zarco
Pablo Zarco 2021년 2월 10일
That is the equation. Is an equation with only one variable. Is there any way to solve this without operating by clearing the x?
Cris LaPierre
Cris LaPierre 2021년 2월 10일
V=[2,4,5,6,7];
fp=fplot(@(x)(2+4*7+8-9*6+x)./(3+4*6*V+3*x))
fp =
5×1 FunctionLine array: FunctionLine FunctionLine FunctionLine FunctionLine FunctionLine
legend("V="+num2str(V'))
Use the plot object to get the x and y data of each line. For example
x1 = fp(1).XData
x1 = 1×45
-5.0000 -4.7914 -4.5455 -4.3075 -4.0909 -3.8679 -3.6364 -3.3856 -3.1818 -2.9285 -2.7273 -2.5080 -2.2727 -2.0542 -1.8182 -1.5647 -1.3636 -1.1199 -0.9091 -0.6699 -0.4545 -0.2294 0 0.2273 0.4545 0.6909 0.9091 1.1546 1.3636 1.5870
y1 = fp(1).YData
y1 = 1×45
-0.5833 -0.5677 -0.5499 -0.5333 -0.5188 -0.5043 -0.4898 -0.4746 -0.4627 -0.4484 -0.4374 -0.4257 -0.4136 -0.4027 -0.3912 -0.3793 -0.3702 -0.3594 -0.3503 -0.3403 -0.3315 -0.3226 -0.3137 -0.3052 -0.2969 -0.2885 -0.2809 -0.2726 -0.2657 -0.2585

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

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by