edmundac

5 Reputation

One Badge

7 years, 230 days

MaplePrimes Activity


These are questions asked by edmundac

I am trying to run this procedure, but am getting an "Error, missing operation", highlighting the conditional break:

is_prime := proc()
     local i, x_check;
     printf(`Enter an integer to check if it is a prime number...`);
     x_check:=parse(readline(terminal));
     if x_check<=2 then
         printf(cat(x_check,` is a prime number.`));
     else
         for i from 2 to x_check-1 do
               if (irem(x_check,i)=0) then
                  printf(cat(x_check,` is not a prime number.`));
                  break 2;
             end if;
           end do;
         printf(cat(x_check,` is a prime number.`));
      end if;
end proc:

If I don't include the integer, I am able to run the procedure, but it does not function like I would like it to. I am running Maple 2022, and can sucessfully run the example conditional break code in the Help. What is wrong with my use of break?

I'm having sone trouble with my matricies after running restart. When creating the matrice, everything is fine and they are defined as normal. But, if I run restart and try to erdefine them, they are defined as some form of 

The only way I've been able to fix this besides restarting Maple is to either add or remove the colon after the matrix, depending on wether there was one. If ther was, when I remove it the matrix is defined normally and vice versa. I'm relatively new to Maple coming from Matlab and would like to start using it more, but this matrix thing is very frustrating. I've attached a copy of the maple file. Thanks

First definition, everything is normal:

After restart, everything goes bad:

Page 1 of 1