I'm trying to plot the S-Parameters in a file .s4p using the RFtoolbox but it seams that the function that I need rfplot doesn't work.
I searched which rfplot to see if the function exsits, and it is, but it's empty. I opened and inside I have this line:
narginchk(1,Inf)
error(message('MATLAB:UndefinedFunctionTextInputArgumentsType','rfplot',class(varargin{1})))
I tried also with other versions of Matlab (I have R2017a) where I work, but everyone have this kind of function.
Do you know why? Al the other functions of RFtoolbox work perfectly. How can I solve it if this problem is not related to my version?
The function exist, and the code exist too, but its hidden. Its a MATLAB proprietary code and they do not want you to know the real code behind it, so you can not see it.
Related
mapminmax is a builtin Matlab function. I am trying to implement something that does autocomplete for functions/subfunctions like this.
I've done a quick search but haven't really come up with what it's called. mapminmax is the only function I know of that implements this feature. It looks like a field of a function (like how a field of a struct).
I've used edit mapminmax to see the insides of Matlab's function but I haven't found anything leading to how this is possible. getParamStructFromArgs looks like it might be able to explain what this is, but it looks like it's related to NNs.
Question: What is this feature called and is there any documentation on this?
Looks like what #hypfco said was right. This "feature" is related to Matlab's package system. I'm sure there's a way to do it by creating a package, but for those who don't want to create such a package there's a simple way of doing this.
If you have a function such as untitled.m, you can create a folder called +untitled in your Matlab directory.
Function's .m file
+Function folder
Then when you do untitled. and press tab in the console, you'll get the following pop-up.
If anyone's got a way to do this inside the .m file, I'll accept that answer instead.
I've recently been using the surfnorm function and would like to access the code to see what it's actually doing. I assume it's stored on my PC somewhere, but I don't know where.
Type in edit surfnorm to open it or which surfnorm to display the path.
I am doing a group project and we are supposed to be using GUIS to create a presentation. In the presentation there is data that is loaded in using an edit text box and our code then goes through calculations and if statements and is supposed to pass certain values to a different GUI. Our instructors do not know how to do it because we have asked them on several occasions and they cannot figure it out. We have tried varargin method and the getappdata method and neither one is working. Does anyone have suggestions? PLEEAASE!!
I would write some "Controller" program that will know open the figures for you and know how to forward the data. Basically it would be a simplified mvc-pattern. It could also assure the figures are opened in correct order.
Somehow my Matlab does not has the function nanvar_base, needed to use the function ttest2 to calculate the t and p value of two sample data. How do I install that function? Is it missing to anyone else?
I had this same issue, the ttest2 function calling a nanvar function from SPM rather than the MATLAB statistics folder. A simple fix is going into 'change paths' in MATLAB and moving the SPM paths to the bottom of the list.
The function ttest2 is part of the statistics toolbox.
However, when I try to edit it, it does not show any calls to nanvar_base.
Did you perhaps try to edit it yourself, and in the process made a mistake? If this is not the case, try edit ttest2 and see where it is located and show the line with the call to nanvar_base.
This function isn't part of MATLAB or any of its toolboxes/add-ons. It must be custom functions. There is a function call nanvar however, in the Statistics toolbox and also in the Financial toolbox. Is this maybe the one you're after? If so, do you actually have the Statistics Toolbox and/or the Financial Toolbox?
the problem is probably another toolbox (like SPM) getting in the way, with their own 'nanvar' function.
Move SPM to the bottom of the path definition list, or remove it completely.
In general moving SPM have a lot of conflicting functions, so always make sure their path is at the bottom.
I had the same issue when calling the function nanvar, and realised that there was a conflict with a function with the same name in the Fieldtrip toolbox (this Fieldtrip function calls nanvar_base). After removing the Fieldtrip/src folder from my paths, it worked fine.
I was wondering if anyone knew if it is possible to have MATLAB type a string for you, as if the user had typed it on the keyboard. I believe it can be done using a shell script or an applescript, but I was wondering if Matlab had a native implementation.
I have tried searching around for it, but have not had any luck. It is not super necessary, but I am just super lazy and want to write a script that will automatically enter information into an application after MATLAB has calculated stuff.
If you know of another simple way of doing this, let me know as well. Thanks a lot!
EDIT:
Adding some code that I used in response to an answer below, using the Java Robot Class
function robotType(text)
import java.awt.Robot;
import java.awt.event.*;
SimKey=Robot;
for i = 1:length(text)
if strcmp(text(i),upper(text(i))) == 0 || all(ismember(text(i),'0123456789')) == 1
eval(['SimKey.keyPress(KeyEvent.VK_',upper(text(i)),')'])
eval(['SimKey.keyRelease(KeyEvent.VK_',upper(text(i)),')'])
else
SimKey.keyPress(KeyEvent.VK_SHIFT);
eval(['SimKey.keyPress(KeyEvent.VK_',upper(text(i)),')'])
eval(['SimKey.keyRelease(KeyEvent.VK_',upper(text(i)),')'])
SimKey.keyRelease(KeyEvent.VK_SHIFT);
end
end
end
Warning, code may not be the best, but hey it was written in like 5 minutes.
I ended up writing an applescript to do everything that I needed Matlab to do. Unfortunately this will not help the Windows people, but myself and the other people using the script are mac users, so it works for us.
I have however, edited my question above to include code that I used initially in Matlab to auto type things. Simply run command as robotType('SomeString') and it will type that string.
I do not believe it will hand spaces or random characters that well, or at all, but it is good enough for abc123. Sorry for no final solution on this.