PDA

View Full Version : Trouble in Matlab writing the symbol ^



lognok
May 7th, 2007, 04:58 PM
Hi there,
My Matlab (2006a) has problem with my danish keyboard-layout, as it refuses to write the (hat/power)-sign ^
When I enter the ^ key, it doesn't show (also tried to press space as this seams to bring it forth in gedit or any other command environment), instead it super scripts the next number I enter. So if I enter 9^9, it shows 9⁹.

If I change my keyboard-layout to Denmark+eliminate dead keys it works, but then I can't write brünger, it becomes br"unger.

Funny thing is when I write some code in gedit which includes the ^ sign and paste it into Matlab (either editor or command line) then it displays correctly and runs!!??.

Is there a way for me to fix this?

Thanks for any reply.

melissawm
May 7th, 2007, 08:44 PM
Hi! What happens if you try typing ^ and then a space after? It should work... If not, I know there are ways to configure keys separately, i'll take a look for you.

engla
May 7th, 2007, 08:50 PM
Typing the space should work. Otherwise you can also run matlab as "matlab -nojvm" (it now runs from the terminal console), but it is uglier..

lognok
May 8th, 2007, 12:46 PM
Pressing space doesn't do anything.

If I type: 9 ^ 9 it gives: 9⁹
If I type: 9 ^ [space] it gives only 9, so pressing space right after the ^ sign doesn't produce anything.

But thanks for your suggestions.

Eric_T
May 9th, 2007, 08:13 AM
I have the same problem on a Norwegian keyboard layout.
I just use ViM for editing my m-files to work around it. There are lots of Matlab-related
scripts out there, and the editing functionality of ViM far surpasses Matlab's editor.

ahmatti
May 9th, 2007, 02:06 PM
There is a bug in Matlabs Java VM that prevents the use of any dead key + space bar combination...
http://www.mathworks.com/support/bugreports/details.html?rp=100994 (needs subscription)

In my finnish keyboard this means that ~ and ^ don't work.

You can fix the problem by remapping the characters to some other keys. I use the following script to map ^ to F11 and ~ to F12.



#!/bin/sh
xmodmap -e "keycode 95 = 94"
xmodmap -e "keycode 96 = 126"


You have to run the script every time after restart (manually or automatically)

lognok
May 10th, 2007, 11:31 AM
Thanks ahmatti, I'll use your script until the jvm problem is solved.

ppm
March 26th, 2008, 10:14 AM
Cheers ahmatti,

In case anyone is wondering where to put that script I created a user-specific config file i.e. ~/.xmodmap with the contents posted by ahmatti.