Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'If codtion for Arrays' topicStudent Support Forum > General > Archives > "If codtion for Arrays"

Next Comment >Help | Reply To Topic
Author Comment/Response
Eugene
03/16/12 10:48am

Dear All:

I have an Array with numbers from 1 to 250. I need to subtract from each element of the array some number (for example 15) and then check if the result is less than 0, return 0, if greater - return this number in power 3. Thus, as a result, I have to get another Array with numbers.

Here is my condition, but it doesn't work and I have no idea how to fix it.

x = Array[{#1} &, 250];
u1 = 15;
If [(x - u1) < 0, 0, (x - u1)^3]

I've already checked everywhere, but the result is still negative.

Could somebody, please, help me?

Thank you in advance!

URL: ,

Subject (listing for 'If codtion for Arrays')
Author Date Posted
If codtion for Arrays Eugene 03/16/12 10:48am
Re: If codtion for Arrays Bill Simpson 03/17/12 3:12pm
Re: If codtion for Arrays Peter Pein 03/18/12 12:32pm
Next Comment >Help | Reply To Topic