Beantwortet
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...

etwa 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 6 Jahre vor | 0

Beantwortet
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 ...

etwa 6 Jahre vor | 0

Beantwortet
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...

etwa 6 Jahre vor | 4

| akzeptiert

Beantwortet
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...

etwa 6 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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:...

mehr als 6 Jahre vor | 0

Beantwortet
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...

mehr als 6 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 6 Jahre vor | 0

Beantwortet
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...

mehr als 6 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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......

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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 ...

mehr als 6 Jahre vor | 2

| akzeptiert

Beantwortet
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 ...

mehr als 6 Jahre vor | 0

Beantwortet
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...

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

Beantwortet
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...

mehr als 6 Jahre vor | 0

Beantwortet
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...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 6 Jahre vor | 1

Beantwortet
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 ...

mehr als 6 Jahre vor | 0

Beantwortet
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...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 1

Beantwortet
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 ...

fast 7 Jahre vor | 2

| akzeptiert

Beantwortet
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...

fast 7 Jahre vor | 1

Gelöst


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...

fast 7 Jahre vor

Gelöst


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".

fast 7 Jahre vor

Gelöst


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...

fast 7 Jahre vor

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 0

Beantwortet
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...

fast 7 Jahre vor | 0

Mehr laden