Matlab - Cannot replace the icon Matlab by another - matlab

I can not replace the icon Matlab by another. I have yet to try several code recover on the internet, but it's always the same thing, the Java icon appears and sometimes none are displayed.
Would you another track?
thank you
Here one of the tested codes:
warning('off','MATLAB:HandleGraphics:ObsoletedProperty:JavaFrame');
jframe=get(hObject,'javaframe');
jIcon=javax.swing.ImageIcon('icon.png');
jframe.setFigureIcon(jIcon);
initialize_gui(hObject, handles, false);

The code you show works for me. Are you sure the 'icon.png' file is located in the correct folder? Try specify the full path to the image:
jIcon = javax.swing.ImageIcon(fullfile(pwd,'icon.png'))

Related

Unable to Clear TextField in Appium Android Automation

I used the below code:
web.sendKeys(Keys.chord(Keys.CONTROL,"a"));
web.sendKeys(Keys.BACK_SPACE);
This method almost worked, it cleared first, and is entering an alphabet a, dont know y, I tried element.sendKeys(Keys.Delete); but still no luck, attached is the screen after the method was executed.
enter image description here
The clear function should provide what you're looking for:
element.clear()
Documentation on this can be found in the official Appium documentation.
element.clear() would work but if you actually need to delete something you can use exactly what you have except like this
web.sendKeys(Keys.chord(Keys.CONTROL,"a"));
web.sendKeys(Keys.BACKSPACE);
no _ in BACKSPACE
keep in mind if you want to delete a characters before the cursor use Keys.BACKSPACE, to delete characters after the curser use Keys.DELETE

VSCode - auto_prepend_file for code suggestions

I have been using VS code instead of eclipse for the last few weeks and find it much quicker, easier to use. However there is one thing I can’t seem to figure out.
My php app calls a prepend file which initiates a class called GlobalClass:
$gc = new GlobalClass();
When I type $gc-> in eclipse I get all the functions prompted. This doesn’t work within VS Code.
If I add use GlobalClass or add the $gc = new GlobalClass(); to the top of the file then it works. Is there any way to declare this within VS Code or to point the editor to the code within the prepend file?

MATLAB TODO: Fill in Description

I was trying to find something about LegendEntry in MATLAB, so I clicked it to open the help window, and this is what I saw:
If you want to see it yourself run this code:
h = plot(1:10,1:10);
legend('a')
h.Annotation.LegendInformation
Then you will see at the command window:
ans =
LegendEntry with properties:
IconDisplayStyle: 'on'
LegendEntry is a link to the help file for matlab.graphics.eventdata.LegendEntry which pops up the window in the picture above.
Are you familiar with this? Is this some kind of a problem with my installation?
I use MATLAB 2015a.
What's happened here is that a developer has left a TODO note to him or herself in the comments for matlab.graphics.eventdata.LegendEntry, and has forgotten to remove it before release.
If you'd noticed this in the most recent release, it would probably be worth bringing it to the notice of MathWorks with a bug report: but in fact I've just tried this on 16a and it looks like it's been removed already.
It's not a problem with your installation.

How can I change the name of the file being saved without editing the code? MatLab

I am working on an experiment that take a lot of data samples and save it to different video files. For example, I take data and save it to a file called "slowmotion.avi" and then I take another set of data and save it to another file called "normalspeed.avi".
I am trying to find a way that I could change the name of file being saved without editing the code. The way I am using right now makes me have to open the code and change the name of the file directory within the code and then save the code. I want to make it a lot faster and easier to use.
I have tried the following code to fix this problem but it doesn't work.
graph=input('Graph of experiment: ');
vidObj = VideoWriter('%3.1f.avi\n',graph);
.....
Hope I didn't confuse you.
A possible solution:
graph=input('Graph of experiment: ','s');
vidObj = VideoWriter([graph,'.avi']);
The 's' in the input() function indicates that the expected input is a string, and [graph,'.avi'] simply concatenates both strings.

Moodle local plugins and save_file

I've created a working form within a local plugin and it is inserting data fine into my custom table.
What I want tyo add now is a filepicker element that upon saving the form puts the file into a specified folder.
The filep[icker itself works fine but when I save the form no file appears, the code I'm using looks like this:
$mform->save_file('lowresCh', '/my_form/', false);
I've tried various things in the 'my_form' bit, but to no avail. The rest of the form still puts its data into the custom table and I can see my file in the mdl_files table (marked as draft).
With full debugging on I can get a warning of:
Warning: copy(/my_form/): failed to open stream: Is a directory in /...../lib/filestorage/stored_file.php on line 390
I don't know if I'm approaching it incorrectly or not, any help or pointers in the right direction would be most appreciated. 
Oh and I have read the Using the File API in Moodle forms page, useful in getting me to the point I'm at, but no further.
I solved it by using the filename as the second argument in save_file() and if I prepend a directory then all of the files will be saved within my plugin in a sub directory which is perfect.
So it looks like this now:
$mform->save_file('lowresCh', 'files/'.$mform->get_new_filename('lowresCh'), false);