cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

11-Garnet

Ex:

1 ACCEPTED SOLUTION

Accepted Solutions
11-Garnet

This will solve, thanks everyone for suggestions,

11 REPLIES 11
21-Topaz I

Hi,

hi, i need it in programming, like this,

24-Ruby V

maybe that way:

11-Garnet
(To:Werner_E)

Thanks, but its not working for 'zero'

ex:

24-Ruby V

What did you expect to get with n=0?

My loop runs from 1 to n, not from 0 to n as in your pic!

Reasoning is that n means how often you want to ADD the matrix to itself.

As seen in my example with Rep(test,2) the input matrix is added zwo times, so its seem three times in the result.

There is no error check implemented in my program but of course  n=0 make no sense and the same applies to negative or non-real values.

As written above with n=0 you will get the same result as with n=1. To cope with that so you simply get the very same matrix returned with no repetition, you would have to add a simple if r < 1 and put the loop there.

Here is some error checking:

23-Emerald I

You can use recursion:

11-Garnet
(To:Fred_Kohlhepp)

I can't use this approach in Mathcad 15, Pse guide & do the needful.

21-Topaz I

Hi,

23-Emerald I

What I did should work in Mathcad 15.  I can no longer check it, but there is no Prime magic, this works even in Express.

24-Ruby V
(To:Fred_Kohlhepp)

What I did should work in Mathcad 15.

Yes, sure it does 😉

In the last two examples the evaluation resulted in an infinite recursion, of course.

This could be avoided by exchanging the i=0 for i <=0 or for i<1 but I think that the error is OK anyway.

11-Garnet