Can anyone please help me ? I am not able to find the a value y from x
1 次查看(过去 30 天)
显示 更早的评论
for i=1:cf_n
if x1(i,1)<Vrd_cf(i) && x1(i,2)>Vrd_cf(i)
index2(i) = find((abs(xa(i,:)-Vrd_cf(i)) < 0.001),1,"last");
Y_point2(i) = ya(index2(i));
AZ_L(i) = Y_point2(i);
elseif x1(i,2)<Vrd_cf(i) && x1(i,3)>Vrd_cf(i)
index2(i) = find((abs(xb(i,:)-Vrd_cf(i)) < 0.001),1,"last");
Y_point2(i,:) = yb(index2(i));
AZ_L(i) = Y_point2(i);
elseif x1(i,3)<Vrd_cf(i) && x1(i,3)>Vrd_cf(i)
index2(i) = find((abs(xc(i,:)-Vrd_cf(i)) < 0.001),1,"last");
Y_point2(i,:) = yc(index(i));
AZ_L(i) = Y_point2(i);
elseif x1(i,4)<Vrd_cf(i) && x1(i,4)>Vrd_cf(i)
index2(i) = find((abs(xd(i,:)-Vrd_cf(i)) < 0.001),1,"last");
Y_point2(i,:) = yd(index(i));
AZ_L(i) = Y_point2(i);
elseif x1(i,1)>Vrd_cf(i)
AZ_L(i) = 0;
else
AZ_L(i) = 0;
end
end
Here In this code , xa,xb, xc are different equations and these equations is a matrix of 3 rows and 1000 columns
let me take "xa" only , I am just taking an example
xa = [ 1 2 3 .....................; 0.1 0.2 0.3 .....................; .001 .002 .003 .........................]
based on these condition and for loops
i have to get AZ_L which will be [A1;A2:A3], i.e., 3*1 matrix
problems which i am facing is ,
a. Index should be 3*1 but i am geeting 1*3 (the absoulute values of index is correct but vector is wrong )
b. and due to this all this i am getting is 1*3 , and it should be in 3*1
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!