how to create a function ?
Mostra commenti meno recenti
I want to create a function which gives following information like
fi = @(a,b) ([a:data_len 1:b]);
if x<y
A= x:y ;
if x>y
A = fi(x,y);
for example:
if x=6
y= 10
then A= 6 7 8 9 10
but if x= 20 and y=2 like time in a watch
then A= 20 21 22 23 24 1 2
but this function only gives 20 1 2 .
1 Commento
Rik
il 4 Ott 2017
You are not very clear in what you want, but I would guess the value of data_len was set to 20 instead of 24 when the anonymous function fi was created.
Risposta accettata
Più risposte (1)
Image Analyst
il 4 Ott 2017
Why not
A = rem(x:y, 24)
It's not clear why you have a 24 in there instead of 0. I've never seen 24 used for an hour in a 24 hour clock.
Categorie
Scopri di più su MATLAB 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!