Few questions and again if statement - Printable Version +- HP Forums ( https://www.hpmuseum.org/forum)+-- Forum: HP Calculators (and very old HP Computers) ( /forum-3.html)+--- Forum: HP Prime ( /forum-5.html)+--- Thread: Few questions and again if statement ( /thread-17854.html) |

Few questions and again if statement - Amer7 - 12-25-2021 01:36 PM
Hi, it has passed a few months since my last post. I'm wondering is there a Chi table, Z table and T tables in the calculator from witch I can pull values ? If there isn't is there a way to insert them and pull values. 2. Question I'm having a bit trouble again with the if statement. The code is. Code:
The issue is my q1 and q2 variables can be negative and that is a no go. If it's negative i have to add +180. When I write Code:
It correctly fixes the value of p1 if its negative. But I want to do that also if the q2 ends up being negative so I write: Code: `IF(q1<0)` What I want it to do is to: Test if q1 is negative, it it is fix it by adding +180 Test if q2 is negative, if it is fix it by adding +180 If the q1 or q2 are positive don't touch their values, just print them. ( q1 and q2 are independent of each other) Also I have forgot how or why. When I input the values into M1, M2 matrix ( default matrices that are in calculator). Then I pull values like ( M1(1,1), M1(2,4) ) from matrices(M1,M2) to local variables a1,a2,b1,b2... But it doesn't let me. ->I have to first store M1->A1, M2->A2 It doesn't let me for some reason. If i write in program M instead A ( matrix) to run the program i get an error. My goal is to Input values to default matrix of calculator (M0-M9) - Pull values from Matrix ( M0-M9) to local variable Compute A3:=(A2)^(-1)*A1*(A2)^(-1); In prefered case M3:=(M2)^(-1)*M1*(M2)^(-1); So the product of operation from matrices M1, M2 is stored into default Matrix M3 for easy viewing. RE: Few questions and again if statement - roadrunner - 12-25-2021 07:33 PM
1. There are no tables in the prime, but check out the functions: CHISQUARE(d,x), NORMALD([μ, σ,] x), and STUDENT(d,x) 2. As far as your program i think you want an if then else statement: IF(q1<0) THEN q3:=p1+180; ELSE q3:=p1; END; IF(q2<0) THEN q4:=p2+180; ELSE q4:=p2; END; 3. What you want to do with the built in matrix variables should work. Here is an example program that puts two random matrixes in M1 and M2, then calculates M3 with your formula and prints M3(3,3) Code: `EXPORT mattest()` -road RE: Few questions and again if statement - Amer7 - 12-28-2021 11:27 AM
Ah now I understand, thank you once again! RE: Few questions and again if statement - Wes Loewer - 12-28-2021 08:06 PM
(12-25-2021 01:36 PM)Amer7 Wrote: I'm wondering is there a Chi table, Z table and T tables in the calculator from witch I can pull values ? If you have a recent firmware, check out the new Probability Wizard which allows you to interactively enter values. You can find it in the Toolbox / Math / Probability menu. RE: Few questions and again if statement - Amer7 - 12-28-2021 09:03 PM
(12-28-2021 08:06 PM)Wes Loewer Wrote:(12-25-2021 01:36 PM)Amer7 Wrote: I'm wondering is there a Chi table, Z table and T tables in the calculator from witch I can pull values ? Yes, I have checked it. Its very useful. Thumbs up from me. Thank you all. |