“If” Command—Iterations and More using wxMaxima

  • MHB
  • Thread starter ajmirelesme
  • Start date
  • #1
ajmirelesme
1
0
I am trying to make a program using iterations, but never found in the manual how to do mutiple tasks using the "if" command.
(I am simplifying the program to variables h & i)

I have previously defined functions F(x) and f(x).
Also, that the values of h & i are initially:
i: 0 h: some arbitrary value

This is what I have and what I want to add:
Code:
P(h,i);
block([],
if f(h)>=0
then i:i+1 **(*AND DO ANOTHER TASK* h:F(h))**
else **PRINT i AND PRINT h**
);
Is there a way to actually print the values? Or do I have to manually type i & h separately to see their final values?
Also, if you could please help me understand what the brackets "[]" after "block" could work for in the -if- command.

Thank you for your time.

Adan J Mireles
 

Answers and Replies

Suggested for: “If” Command—Iterations and More using wxMaxima

Replies
5
Views
566
  • Last Post
Replies
12
Views
589
Replies
12
Views
6K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
1
Views
713
  • Last Post
Replies
7
Views
685
Replies
16
Views
1K
Top