I have an error on the following code.how to rectify the error ?
조회 수: 4 (최근 30일)
이전 댓글 표시
if true
clc;
clear all;
close all;
c = Ns;
d= 8;
z = f(c, d)
function z = f(c,d)
if ~mod(c,d)
z=0
else
z=d-mod(c,d);
end
end
end
댓글 수: 0
채택된 답변
KSSV
2018년 1월 22일
function z = myfunction(Ns)
c = Ns;
d= 8;
z = f(c, d)
end
function z = f(c,d)
if ~mod(c,d)
z=0
else
z=d-mod(c,d);
end
end
Call the function:
Ns = rand ; % any value
z = myfunction(Ns) ;
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!