Answered
address a subplot without using the subplot command
AxesHList = findobj(FigureH, 'Type', 'axes'); set(AxesHList, 'Xcolor', [0 0 0], 'Ycolor', [0 0 0]); The behavior of |sub...

9 years ago | 1

| accepted

Answered
Zoom and Data Cursor callbacks used with saved figures
Note that the elements of the figure have new handles after loading. Then hZoom = zoom(gcf); set(hZoom, 'ActionPostCallb...

9 years ago | 0

Answered
Sparse matrices and memory
See: <https://www.mathworks.com/help/matlab/ref/computer.html |doc computer|>, 2nd output |maxsize|: maxsize, the maximum n...

9 years ago | 2

Answered
Index exceeding matrix dimensions. When ran displays Index exceeds matrix dimensions. Can't figure it out
Use the debugger. Type this in the command window: dbstop if error Now run the code again until it stops at the error. F...

9 years ago | 0

Answered
Problem using hold all
It is safer and in my opinion easier to specify the parents explicitly: Fig1 = figure; Axes1_1 = subplot(1,2,1, 'Pare...

9 years ago | 1

| accepted

Answered
Run Win32 executable and get status of completion...
exeFile = 'c:\temp\example.exe'; startInfo = System.Diagnostics.ProcessStartInfo('cmd.exe', ... sprintf('/c ...

9 years ago | 1

Answered
How do I find the best fit line of data without the polyfit command?
But |polyfit| uses linear algebra methods also. Or is this a homework question and you should program this _by your own_? Then i...

9 years ago | 2

Answered
Why this error occurs?
This is an extremely ugly code. It is impossible to debug this pile of redundant blocks. It looks like you lost your patients al...

9 years ago | 0

Answered
access an GUI axes from a different m file
There are different ways to provide the handle of the axes to the 2nd GUI: * Forward the handles struct of the first GUI to t...

9 years ago | 0

Answered
Moving sum of a matrix
I know, you do not _like_ loops, but for a comparison of the speed this might be interesting: A = [3 2 5 6 1 4; 3 6...

9 years ago | 1

Answered
Explanation of source code written in Matlab
As long as the code does not contain meaningful comments and a clear help section, it is doing "something". There is no chance t...

9 years ago | 0

Answered
I want to get a text file into matlab, but doesn work
Perhaps you want: [fid, msg] = fopen('file.dat'); if fid == -1, error('Cannot open file: %s', msg); end while ~feof(f...

9 years ago | 0

Answered
Can I install a single license on a PC and a Mac if I don't use them simultaneously?
This is the public forum. While the Matlab users can interpret the license conditions, the MathWorks *knows* their meaning exact...

9 years ago | 0

Answered
Problem with intersect function?
Perhaps you want: index = ismember(data, result, 'stable', 'rows'); result = data(index, :); % [EDITED, Typo fixed] ...

9 years ago | 1

| accepted

Answered
How to write a function to test for positive or negative numbers
This sounds like a homework. Therefore the forum will not post a solution, because this is *your* homework. Post, what you have ...

9 years ago | 2

| accepted

Answered
How to find the index of a cell array
names2 = {'Tom Mat', 'Joey Votto', 'Hans Kanal'}; found = ismember(names2, {'Joey Votto'}) Or easier and faster: i...

9 years ago | 0

Answered
my i bought a license in 2016 and i would like to know if this license is still active or if i have to buy a new one.
Login into your Matlab account and check the active license. If this does not work for any reasons, contact MathWorks, because t...

9 years ago | 0

Answered
White line in eps fig
It is a good idea to search in the forum before asking. You will find a bunch of corresponding threads: <https://www.mathwork...

9 years ago | 0

Answered
Dumb mistakes we make with MATLAB.
I needed a short and confusing command for a demonstration: eval = 1:255 eval eval Error: "eval" was previously used ...

9 years ago | 0

Answered
A command in the script runs in the Command window but not in the script
If there is a conflict between the names of a function and a variable, simply rename one of them. Sounds like a trivial solution...

9 years ago | 0

Answered
Common errors which increases the computation time
It would not be efficient to post a list of all possible problems. Better post the relevant part of your code. Find the bottl...

9 years ago | 0

Answered
Know if my script gets an error
What does "running a Matlab script in a Linux console" exactly mean? You can run Matlab scripts inside Matlab only. Then the com...

9 years ago | 0

| accepted

Answered
When I make a system call from matlab in Linux, does it use a different thread?
|unix cmd &| processed the |cmd| in the background. The operating system is responsible then to evaluate the commands to move th...

9 years ago | 1

Answered
Is it possible to avoid copy-on-write behavior in functions yet?
See also Loren's very useful article: <https://blogs.mathworks.com/loren/2007/03/22/in-place-operations-on-data/> . You are r...

9 years ago | 5

Answered
Is it not possible to set script directory to current directory as default in MATLAB?
It is not clear, why you do this at all. Is the purpose to access other files in the same folder as the script without specifyin...

9 years ago | 0

Answered
Can someone explain to me how a color image is converted to binary form. without the use of the functions? The methodology behind it
There are many techniques for converting a grey image into a binary one. See e.g. <https://en.wikipedia.org/wiki/Dither>. You...

9 years ago | 0

Answered
What's the best way to pass structures into/out of C++ functions?
Why do you think that the wrapper is "not ideal". Either the Matlab struct is converted to a list of variables by an M-function,...

9 years ago | 0

Answered
Minimize difference between two populations.
What exactly is "a data set"? Do you mean a [2 x 100] matrix? What is "the difference" you want to minimize? Does the order of t...

9 years ago | 0

Answered
How to decrease the execution time in Matlab ?
No, there is no magic "run faster" setting. Some algorithms can be parallelized by |parfor|. Sometimes this does not help, e....

9 years ago | 0

| accepted

Answered
How do I iterate the following matrix?
Replace your: P1 = 10; by for P1 = 500:10:600 Then either omit the figure number in |figure(1)| to create a new ...

9 years ago | 0

Load more