MATLAB: F1 help function in Editor refers to a wrong function - matlab

I am using MATLAB 2014b.
If I write a line like
A = regexp(strcat('some string'),expression);
Placing the cursor on the first function (here regexp) lets me get the content help of it by pressing F1.
If I now move the cursor to strcat I also get the content help of regexp. This is just an example; the same problem happens for every function.
In MATLAB 2012b, I get the correct behavior. How can I make MATLAB 2014b act the same way?
Note: If I highlight the function name and press F1, I'll get the right content help. But this is just a workaround.

I don't have MATLAB 2012b to test on right now and I'm running 2015a, but I feel it might be an issue with your test case. Try putting the cursor within the brackets that the function is called with. Let me know if it works in 2014b!
regexp help:
strcat help:

Related

Simulink matlab function block

How do I display the current value of a variable in the matlab command window? In matlab I usually use disp(var) and it will output the variable value into the command window. However in the MATLAB function block if I were to enter disp('hello') it doesn't show any output in the command window. I am using matlab 2014b.
You idea for displaying output value in the command window is not a good approach to solve your issue. I would suggest you look at scope block if you'd like to see the value during simulation. Or use To Wrokspace block if you'd like to output the value into main workspace.
For debugging your code and design, read and use Simulink Debugger should be helpful.

How could a function be included in a script matlab r2016b?

Matlab r2016b allows for functions to be embedded in scripts. I am trying to run this script, but an error occurs, and I do not know what rules I am breaking. Here is the script:
clear
clc
out=nestedvol(2)
function outvol=nestedvol(l)
outvol=2*l
end
x=4 %this line does not work.
This question continues off of In MATLAB, can I have a script and a function definition in the same file?
How could I get a script to continue after the embedded function ends? Would an anonymous function be appropriate for this?
The reason I ask this is because I make review scripts for chapters of the matlab book I am reading, so it would be nice to section areas of the code off. It seems like if any function is not included, ctrl enter does not work.

matlab function parser on gui

I need to do a parser on my gui in matlab in which you can type your own function formula that will be used for computations. I came up with to make function that gets function from edit box as a string and saves it to m-file as a function. But any further calling changed file do not bring expected results if the first form of function were stored in memory. Do you have any other ideas to solve it?
Instead of writing the code to an m-file, take a look at the eval function.

Refactoring variables and function names in MATLAB?

In eclipse you can refactor all variables and function names by hitting CTRL+SHIFT+R which is great. I am editing someone else's matlab script and would like to change a lot of their varaibles and I was wondering if there is something similar in matlab?
Matlab editor in 2012a allows you to press shift + enter to change all of the common variables in a script or function when you start editing one of them.
Otherwise I would suggest find and replace.

How to find call an external function from a GUI in MATLAB?

I have an external function (myfun.m) which will generate 4 images. I want to use a textbox in a GUI to give the function the input parameters (e.g. the name of the original picture), but I have no clue how I can run myfun.m in my GUI. PLease help
First, I would recommend having a different textbox for each input to your function. For example if your function asks for 4 inputs, I would have four textboxes. This will avoid pain on the user's end to format their text input a certain way, as well as pain on your end on parsing a long text string into several inputs.
Second, if your function is within MATLAB's path, then you can call that directly from your GUI no problem just as you would any of MATLAB's built-in functions. You probably want to make a push-button that has a callback to execute that functions.
The way the callback for this function should look is to l