답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 4

| 수락됨

답변 있음
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년 초과 전 | 1

| 수락됨

답변 있음
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년 전 | 0

| 수락됨

답변 있음
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년 전 | 0

답변 있음
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년 전 | 1

| 수락됨

답변 있음
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년 전 | 0

답변 있음
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년 전 | 1

| 수락됨

답변 있음
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년 전 | 0

| 수락됨

답변 있음
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년 전 | 0

| 수락됨

답변 있음
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년 전 | 2

| 수락됨

답변 있음
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년 전 | 0

답변 있음
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년 전 | 0

| 수락됨

답변 있음
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년 전 | 0

답변 있음
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년 전 | 0

답변 있음
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년 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 1

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

| 수락됨

답변 있음
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년 초과 전 | 1

답변 있음
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년 초과 전 | 2

| 수락됨

답변 있음
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년 초과 전 | 1

문제를 풀었습니다


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년 초과 전

문제를 풀었습니다


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년 초과 전

문제를 풀었습니다


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년 초과 전

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

답변 있음
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년 초과 전 | 0

더 보기