What version of Matlab should I install to make dsearch() work? - matlab

I have a code in MATLAB that I need to run once to get some quick reference results. This code uses dsearch(), and I relized that this function has become deprecated and has been substituted by dsearchn(). I tried to follow some suggestions to make it work but I didn't succeed (it's my absolute first time with MATLAB) and I just need to run this code once to get some numbers. Which MATLAB versione should I install to make it work?

dsearch was removed in MATLAB R2012a, therefore you may use any version of MATLAB before R2012a.
If you have an active MathWorks account, you may access the documentation archive here.

According to MathWork's release notes, this function started printing a warning on release 2010a. So you should be fine either using it or a previous version.

Related

Problems with writing Transfer Functions as Rational Expressions in s

Why do I get the error:
[Undefined function 'tf' for input arguments of type 'char'.]
when I'm trying to use [s=tf('s');]?
The code worked just fine before updating my license, so I'm wondering if I missed something in the update.
Taking a look at the documentation, you see at the top left that the function tf is part of the control systems toolbox. The output of ver tells you that no toolboxes are installed or activated. If you previously had the toolbox present on the same system there is probably a license issue. Try deactivating / activating the license.

Is 'Digit Classification Using HOG Features' matlab example only available in the 2014 version?

I use the R2013a version of matlab. I tried to follow the path,
syntheticDir = fullfile(toolboxdir('vision'), 'visiondemos','digits','synthetic');
handwrittenDir = fullfile(toolboxdir('vision'), 'visiondemos','digits','handwritten');
but there were no files named digits.
Also upon running,
trainingSet = imageSet(syntheticDir, 'recursive');
testSet = imageSet(handwrittenDir, 'recursive');
I got the following error : Undefined function 'imageSet' for input arguments of type 'char' .
I'm trying to attempt this example, http://www.mathworks.in/help/vision/examples/digit-classification-using-hog-features.html
Usually I would consult the release notes of the respective toolboxes to find out when a new function was introduced.
For the digit classification example mentioned, it uses imageSet a new feature in R2014b, as well as the extractHOGFeatures function introduced in R2013b. It also uses fitcecoc from the Statistics toolbox. This a new function in R2014b.
It would be nice if the documentation provided this information in easier way...
This example was added in R2013b. Generally, if you have an older version of MATLAB, you should use the documentation that came with it. The documentation on the web is for the current release, and so it will naturally contain new examples and functions not present in the older versions. However, if you click "Other Releases", you can see the archive of the documentation for the previous releases. This way you can easily check when a particular function or example was added.

running compiled matlab from matlab

I am trying to run compiled MATLAB code (by mcc) from inside MATLAB in a way that I can avoid using another license that is required by the compiled code. We need this because we run this same specific code part again and again and execution is stuck due to license waiting. We don't want to buy tons of this specific license just to mass run the same part. Is there any way to do this? tutorial?
Is it possible to compile a .m file to dll/so and wrap it like a mex and call it from MATLAB on the fly? How would I pass and retrieve complex arguments?
According to
http://www.mathworks.de/products/compiler/description3.html
creating shared libraries should well be possible.
Concerning passing and retrieving complex arguments:
If you plan to use mex, I'd assume you should be able to call the shared-library "main"-function with any arguments you'd like, using the mxArray type that you'll have to use anyway.
To run the MATLAB-compiled code in MATLAB, you want codegen, part of the MATLAB Coder. See this blog post on generating C code from MATLAB. The alternative, deploying code with mcc/mbuild and then reloading it into MATLAB with loadlibrary is rather contorted, and I wouldn't advice it.

Xcode (10.7) -- clGetProgramBinaries results unreadable

I have an OpenCL kernel that runs well but I want to look at the intermediate code. I use getprograminfo to pull out the binary and save it to a text file. I've tried this with nVidia, AMD, an i7 and a Xeon.
In all of these cases the binary is unreadable.
I understand that on OS X the chunk of data returned is actually a binary plist. I've found instructions for using plutil to convert it to xml, and they work.
It's still unreadable ... though I've seen instructions online that this is where you find the PTX code (in the case of my AMD 5870). There's the expected clBinaryData key but the data under that key is still one big chunk of stuff, not readable IL instructions in text form.
I'd really like to examine the intermediate language to assess inefficiencies in my use of the gpu. Is this simply not possible under Xcode? Or, what am I doing wrong?
Thanks for any information!...
If you run your program with following environmental variable set you should see .IL and .ISA files in your directory.
$ GPU_DUMP_DEVICE_KERNEL=3 ./my-program
Another way is to use AMD APP Kernel Analyzer (which comes along with AMD APP SDK) to look at the Intermediate file i.e IL and ISA.
(I am not sure whether AMD APP SDK available for MAC or not).
One more option according to APP SDK documentation, put the below in your host code.
putenv("GPU_DUMP_DEVICE_KERNEL=3");
References
AMD OpenCL Programming Guide
AMD Devgurus forum
(Making this a top-level answer so I can do some formatting.)
ocluser's answer was very helpful, in that it was enlightening and caused great learning, though it did not, alas, solve the problem.
I've verified that the environment variable described is being set, and is available to my application when run from within xcode. However, it does not have (under OSX) the highly desirable effect it has under Linux.
But, I now know how to set environment variables in 7 of 8 different ways. I also set "tracer" envars to tell me which methods are effective within the scope of my application. From the below, you can see that both the method of "edit scheme" to add arguments works, as does the "putenv" suggested by ocluser. What didn't set it in that scope: ~/.MACOS/environment.plist, app-specific plist, .profile, and adding a build phase to run a custom script (I found at least one other way within xcode to set one but forgot what I called the tracer and can't find it now; maybe it's on another machine....)
GPU_DUMP_DEVICE_KERNEL is 3
GPU_DUMP_TRK_ENVPLIST is (null)
GPU_DUMP_TRK_APPPLIST is (null)
GPU_DUMP_TRK_DOTPROFILE is (null)
GPU_DUMP_TRK_RUNSCRIPT is (null)
GPU_DUMP_TRK_SCHARGS is 1
GPU_DUMP_TRK_PUTENV is 1
... so, no this doesn't really answer the question, but expands on it a bit. Sorry if poor form. Thanks!
Have not given up and shall provide an actual problem-solver if I find one.

Failed to find library 'powerlib' matlab. Simulink program executing

When I tried to run a Simulink program under my R2009a Matlab, it showed an error message as follows: Failed to find library 'powerlib' referenced by 'dcmotor_openloop/Armature Current '. This library must be on your MATLAB path.
I'm wondering where I can find this powerlib.
As #Edric mentioned, powerlib is built into SimPowerSystems. The error you see can thus have two causes
(1) There is no installation of SimPowerSystems in your copy of Matlab. Type ver at the command prompt to check for what toolboxes you have installed. If SimPowerSystems doesn't show up in the list, you will have to get the toolbox, otherwise you won't be able to run the model.
(2) Your installation of SimPowerSystems is somehow corrupt. This has never happened to me in Matlab so far, but with modern technology, anything is possible. A fresh install should solve this.
powerlib is a Simulink library shipped as part of SimPowerSystems, see the product page here: http://www.mathworks.com/products/simpower/.
This should really be a comment on another answer, but I can't comment due to reputation.
From at least R2016b, perhaps earlier too, It's no longer called SimPowerSystems. It's now SimscapePowerSystems. You need that plus the bare Simscape package installed.