必须创建一个matlab计数器 [英] have to create a matlab counter

查看:79
本文介绍了必须创建一个matlab计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Q-从0:limit-1创建一个计数器"(例如,如果选择3,它将显示0,1,2).计数器的长度在程序中没有确定,应在运行时确定,并且输入可以互不相同

Q- Create a "counter" from 0:limit-1 (for example if you choose 3 it will display 0,1,2). The length of counter is not determined in the program and it should be determined when it is being run and the inputs can differ from each other

推荐答案

不是很确定你的意思...但是

not really sure what you mean...but

for i = 0:limit-1
    disp(i)
end

将显示0,1,2 ... limit-1

will display 0,1,2 ... limit-1

这篇关于必须创建一个matlab计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆