matrix corresponing to the minimum value of the difference
조회 수: 1 (최근 30일)
이전 댓글 표시
m=2
t=[1 0 0; 0 (1/sqrt(2)) (1/sqrt(2))];
v1=0.956
v2=2.4
a=[ 0 1 0];
b=[0 1 1];
p=b-a;
d1=m*a;
for x=1:1:m+1
c=d1+p*(x-1)
f=transpose(c);
vndq=t*c;
vnq=vndq(1,1)
vnd=vndq(2,1)
d(x)=abs(v2-vnq)+abs(v1-vnd)
n=min(d)
end
In the given code minimum value of d matrix corresponding c matrix
댓글 수: 4
Stephen23
2017년 2월 2일
편집: Stephen23
2017년 2월 2일
@JAGADEESH JAGA: it is not the capitals in the code, but the capitals in the English that is the problem: on most forums this is considered to be "shouting", and is not very polite (do an internet search):
Communicating on an online forum is just like real life: the more polite and considerate you are, the more help you will receive.
답변 (1개)
Niels
2017년 2월 2일
DEAR CAPTAIN CAPSLOCK
CANT READ YOUR CODE. BUT PEOPLE CONTINUE USING COMMANDS WITHOUT READING THE DOCUMENTATION. TRY MIN(D(:)) OR MIN(MIN(D)). THIS WILL PROBABLY NOT WORK SINCE YOU WOULD HAVE TO DEACTIVATE CAPS LOCK
댓글 수: 1
Niels
2017년 2월 3일
편집: Niels
2017년 2월 3일
About editing your question. It was all about the sentence after your code which is still unreadable since you did not use {}code. In your for loop you overwrite c 2 times. Hence c is a vector and no matrix. Preallocate c as 3x3 array
c=zeros(3,3); for i=1:m-1 c(i,:)=... end MinimumOfaMatrix=min(c(:));
Dont use x as index pls... and maybe add a question
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!