The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 how to set matrix values?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
circumvent Posted - 07/29/2009 : 10:06:27 PM
I want to plot a cut 3D surface, for example z=x^2+y^2, plot the range from -10 to 10 for x and y

Now I create a new matrix, set dimentions, x and y cooridinates from -10 to 10, then I set value, cell(i,j)=x^2+y^2.Everything works.


Next I only want to plot half of the data, for example, only x>y+1. So I get the script Windows out. I understand that I should make a i and j loop to call cell(i,j). But how should I assign the x, y values to the Matrix?
The idea should be
loop (ii,1,32)
{
loop (jj,1,32)
{
if (x>y+1) z=x^2+y^2.
else z=0.



}
}

Thanks.
1   L A T E S T    R E P L I E S    (Newest First)
larry_lan Posted - 08/03/2009 : 10:47:22 PM
Hi:

You can create an Origin C function like:

double setmatrixvalue(double x, double y)
{
	if (x>y+1)
	{
		return x^2+y^2;
	} else
	{
		return 0;
	}
}


And Call this function in Set Matrix Value like

Cell(i, j) = setmatrixvalue(i, j)


Thanks
Larry
OriginLab Technical Services

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000