Answered
A constructor call to superclass appears after a return
Call <https://www.mathworks.com/help/matlab/ref/error.html error> instead of disp and return. The constructor must return a va...

6 years ago | 0

| accepted

Answered
No performance improvement with preallocating for object arrays
Your pre-allocation code is doing the work twice. Try profiling your code. |ObjectArray( numberOfObjects ) = classObject| wil...

6 years ago | 0

Answered
Matlab: Retrieve data from libstruct field where actual data exceeds struct layout
The placement of a small array at the end of a structure and indexing into it is a common practice that is not supported by the ...

6 years ago | 0

Answered
Design choice for iterating over a cell array
There was not much choice in how the language could do it. |For| was initially defined to loop over the columns of the input ma...

6 years ago | 4

| accepted

Answered
Matlab running slower on Linux than Windows 7
You appear to be running different versions of MATLAB on the two machines (the list of reference computers is different in you b...

6 years ago | 1

| accepted

Answered
Can the matlab profiler be used in code employing classes with overleaded methods?
The profiler should work just fine in this situation. However without a bit more information or an example All we can do is gue...

7 years ago | 0

| accepted

Answered
Why did the -nodesktop startup option disappeared from the documentation?
Short answer: -nodesktop has never been officially supported on Windows. This blog may answer any further questions: <https:...

7 years ago | 0

Answered
Method chaining unexpected behaviour?
In general indexing into the output of a function call, what you call method chaining is not supported in MATLAB. Property acc...

7 years ago | 1

| accepted

Answered
Loading C++ shared library DLL into matlab
Loadlibrary works for C or C++ libraries that have C interfaces. It appears to me (from a quick look at the header file) that t...

7 years ago | 0

Answered
Precision lost when change numbers to string
Similar to how you were doing it: ST=join("Hi " + num2str(A',"%1.12e"), newline ) ST = "Hi 2.101000000000e-06 H...

7 years ago | 1

| accepted

Answered
updating P-code
No there is not. In general this should not be necessary unless you have a very old p-code file. The last time the format was ...

7 years ago | 0

| accepted

Answered
What happens on Ctrl + C?
Two things happen when MATLAB returns back to the command line: # Memory leaked by any mex files is cleaned up (mxMalloc......

7 years ago | 0

| accepted

Answered
Error management in OOP framework.
I am not sure if this code helps you or not but have you tried subclassing MException to add an object? Things to look for ...

7 years ago | 2

| accepted

Answered
segmentation fault when access the pointer generated by mxMalloc written in C only in Ubuntu (works well in Windows)
It looks to me that the c code is coded for a 32 bit machine and needs updates to be compatible with 64 bit systems. This line ...

7 years ago | 0

Answered
defining libpointer for boolean ouput using calllib() functions.
If you look at |libfunctions -full UraganLib| for isMotorReady it will require two inputs. All pointer arguments are passed bot...

7 years ago | 0

| accepted

Answered
Performance of MATLAB instances over time
What you are describing sounds like fragmentation of the Windows memory manager. This <https://www.mathworks.com/matlabcentral/...

7 years ago | 0

Answered
Does Matlab r2017a manage memory differently than r2016b? (out of memory issues)
There were no global changes in how R2017a manages memory. I expect your problem is due to a change in one function. What funct...

7 years ago | 0

Answered
Will memory leaks happen when the MEX file contains new & delete or STL containers (C++)?
The short answer is: Put anything allocated with a standard allocator into a smart pointer (unique_ptr, shared_ptr,...) and nev...

7 years ago | 0

| accepted

Answered
Creating variables consisting of many elements
If you don't mind strings and have R2017a I like: "x"+(1:10) Or if you want a cell array or have 2016b: cellstr(strin...

7 years ago | 1

Answered
Call .dll into MATLAB function/code and simulink
Your header file contains c++ code (namespaces for one). Loadlibrary has never supported c++ code in headers. You are free to ...

7 years ago | 0

Answered
How do I get function prototypes for PowerPoint add-in macros when using actxserver('PowerPoint.Application')?
I have never actually done this but I am going to give you an educated guess based on normal MATLAB use and error message interp...

7 years ago | 0

| accepted

Answered
How do I link a library (.dll and/or .lib) to my mex code?
The reference parameters will not work with loadlibrary because c does not support the "&" reference c++ syntax. To load this l...

7 years ago | 1

Answered
correct use of pointer arithmetic with lib.pointer
Assigning a new value to the base (original) pointer of a user created libpointer invalidates all pointers created from it. If ...

7 years ago | 2

| accepted

Answered
Mex programming for a beginner
I suggest a two pronged approach. # Get Loadlibrary working if at all possible. There is only one real error in your loadli...

7 years ago | 1

Solved


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

7 years ago

Solved


The Hitchhiker's Guide to MATLAB
Output logical "true" if the input is the answer to life, the universe and everything. Otherwise, output logical "false".

7 years ago

Solved


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

7 years ago

Answered
Problems with calling a function from a dll
Without an error message or description of what is going wrong all we can do is guess at it. I would start with this code inste...

7 years ago | 0

Answered
Dynamic allocation of mxArray structure
Although the code example you linked to will do the resizing operation on a structure and in general I like it better then the c...

7 years ago | 0

Answered
How to use memmapfiles safely for inter-process communication?
In MATLAB on Intel (x86) platforms I believe this code is safe and will work correctly. Because the communication process is to...

7 years ago | 0

Load more