value assigned to the variable might be unused.

조회 수: 2 (최근 30일)
jakaria babar
jakaria babar 2017년 11월 27일
댓글: jakaria babar 2017년 11월 27일
what's wrong with the variable "v".Please help.
function [s,m,b] = non_decr(v)
v = [x,y,z];
if x<=y && y<=z
[s,m,b]=deal(x,y,z);
elseif x<=z && z<=y
[s,m,b]=deal(x,z,y);
elseif y<=x &&x<=z
[s,m,b]=deal(y,x,z);
elseif y<=z && z<=x
[s,m,b]=deal(y,z,x);
elseif z<=y &&y<=x
[s,m,b] = deal(z,y,x);
else
[s,m,b] = deal(z,x,y);
end
end

채택된 답변

Birdman
Birdman 2017년 11월 27일
Change line
v = [x,y,z];
to
x=v(1);y=v(2);z=v(3);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surfaces, Volumes, and Polygons에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by