HP Forums

Full Version: PPL: element-wise operations on Vector
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In the previous firmware I was able to write
Code:

x := [1, 2, 3, 4, 5];
y := x.^2 * 9.8765;
which set y to a Vector with the square of each individual element in x.
This "dot-operator" Syntax was identical what I use in Matlab or Octave - very compact and convenient.

In the April 2016 release this is now flagged as a syntax error and I have to resort to a loop or other relatively ugly means to perform the same type of calculations (e.g. using the Matrix initialization function).

Is it correct that this feature was removed? Probably not to recover 8MB of RAM ;-)

Martin
Which mode [Home] or [CAS]?

As shown it works in [CAS], but you need to add a space after the x (before the ".^" ) in [HOME]"

x := [1, 2, 3, 4, 5];
y := x .^2 * 9.8765; // x [space] .^2 in [HOME]

-Dale-
(04-25-2016 10:31 AM)Martin Hepperle Wrote: [ -> ]Is it correct that this feature was removed? Probably not to recover 8MB of RAM ;-)

From what I know, 8MB of RAM have been recovered without removing any feature.
(04-25-2016 10:31 AM)Martin Hepperle Wrote: [ -> ]Is it correct that this feature was removed? Probably not to recover 8MB of RAM ;-)

I think it is the space as stated. We will investigate if this is now being flagged on purpose (think 123.*2 - that is rather ambiguous). However, we will investigate it to figure out if this was unintentional.
(04-25-2016 10:50 AM)DrD Wrote: [ -> ]Which mode [Home] or [CAS]?

As shown it works in [CAS], but you need to add a space after the x (before the ".^" ) in [HOME]"

x := [1, 2, 3, 4, 5];
y := x .^2 * 9.8765; // x [space] .^2 in [HOME]

-Dale-

Thank you for pointing this out, Dale,

I have this problem inside a program. Not directly in HOME or CAS expressions.

I had simply saved and restored my program which worked in the previous release without the space. I do not think that I was in CAS mode when I ran the program before. At least the behavior should be consistent and documented.

I also found that many programs had some gibberish (far east) characters (thanks to Unicode) attached behind the end of the programs after restoring. Of course the programs then failed the "Check".

Obviously the length of the file read back was longer than the original length and the content of some read buffer was appended.
I used drag and drop in the connectivity toolkit to copy these files from the emulator to the hardware.
I had to remove the (one to three) lines manually after restoring the programs.

Martin
Reference URL's