我有一个向量的大小1 * 152。现在我想找到下一个质数每个数字出现在向量的. .
例:向量是一个=[2 4 7 8]我要输出[2 5 7 11]. .即。,如果the number is a prime then that number will be the output i.e., like 2 and 7 in the given example...
我试着使用nextprime喜欢低于它给了以下错误:
案例1:
> > nextprime(信谊(100))
未定义的“nextprime”函数输入参数类型的“符号”。
案例2:
> > nextprime (3)
未定义的“nextprime”函数输入参数类型的“双”。