Display an Error Message
Mostra commenti meno recenti
Hi , ive tried to write a function which would Display an error but for some reason i dont know why, but it dosent work ,and i dont know where i wnet wrong .I want n to denote the positive integer that is greateer than or equal to 3 or otherwise the function will display ''error.your input is invalid
n=input ('sequence_matrix_');
if n > 3
disp ('Error. Your input is invalid.');
else
fib=[1,3:n];
for i=3:n
fibb(i)=fibb(i-1)*3+fibb(i-2);
end
end
diag(fibb)
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su App Building in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!