Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to store values to the matrix and retrieve later as shown below ?

조회 수: 1 (최근 30일)
Waranga Ratnayake
Waranga Ratnayake 2019년 3월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
I want to store values on L to J correspondently and make a plot later using J or L(If values can store in L instead J)
p(:,1) = [0;0];
r(:,1) = [0;0];
L(:,1) = [0];
J(:,1) = [0];
syms r1 r2
for n=1:0.1:x;
p =[0 (1/3)^n;(1/2)^n 0];
[V,D]=eig(p);
L= [V(2,1)/V(1,1)]
J(1,n)=L
end

답변 (1개)

KSSV
KSSV 2019년 3월 27일
YOu can further reduce the variables:
m = 10 ;
L = zeros(m,1) ;
J = zeros(m,1) ;
x = 1:0.1:m ;
for i = 1:length(x)
n = x(i) ;
p =[0 (1/3)^n;(1/2)^n 0];
[V,D]=eig(p);
L(i) = [V(2,1)/V(1,1)] ;
end

이 질문은 마감되었습니다.

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by