Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
Hi everyone,
I have this function that I used to find R from it
Now I want to find the min, max and max from it ..but didn't work . It tells me that the values should be scalar
and when I do this , it gives me the same results of the original one not the average
I need to find the min, average , and max values
Thanks
Yusra
Solved! Go to Solution.
Hi Yusra,
Your z.tips is a range, not a vector. Applied to a function that makes the function result a range at best, but not a vector.
Try making z.tips a vector, e.g. with:
and vectorise your expression:
Success!
Luc
It didn't work, do you think I'm missing something?
Don't vectorise the other expression:
Success!
Luc
When I do this another error appears because I change ztips... but when ztips is range it works again
You may need to recalculate the sheet.
Success!
Luc
thanks it works
@YA_10963798 wrote:
When I do this another error appears because I change ztips... but when ztips is range it works again
When you do - what?
Luc told you that you should NOT use vectorization when you DEFINE the function R...
NOT
but rather
as you initially did.
Or are you irritated because of the green boxes and think that they indicate an error? They don't, its just a warning because you already had defined ztips before and you are now overwriting/replacing that definition by a new one. Warnings can be turned off in the menu
Click the upper part of that button to turn on or off the warnings. Clicking the arrow let's you select in detail if the warning should concern functions, units, constants, variables.
As you are using Prime 11 you can also use the new function "vec" to define ztips as a vector, if you like:
You can't vectorize the definition of the function R.s;cal;max because this would also vectorize the vectors z and q, but these must remain vectors.
If you find it annoying having to vectorize the function CALL every time when you use it in your sheet with e vector ztips as its argument instead of the expected scalar argument, you can define it using a local function which you call vectorized in the definition:
That way you can use that function either with a scalar argument ztips or with a vector as its argument.
But you should not use a range as this would be a misuse of a range for something its not intended for. Exception is when you make a plot. Here using a range is perfectly OK:
You may get the same plot if you use a vector instead, though.
Ranges should be used in three occasions only:
Brilliant as always thanks
