Problem with figures in MATLAB - figures are full of glitching pixels
This is the best screenshot of the year 2021. Thank you. Did you update the graphic drivers? Does this occur also, if you use ...

12 dagar ago | 0

| accepted

Automatically continue a line
This cannot work without further assumptions. Because the existing line is drawn with some noise, e.g. due to rounding effects, ...

12 dagar ago | 2

I want to know the difference between 1 and 1.0000
The output is mimited to 4 digits after the decimal point. Then "1" means 1.0, and "1.0000" means that there is a digit differin...

12 dagar ago | 0

switching from 2013b VERSION TO 2020. Accessing figure handle from plot command
No, this did not reply a figure handle in R2013b: ep_hdl=plot(0,0,'Visible','off','Color','k'); The plot command replied a lin...

12 dagar ago | 0

Matrix dimension must agree HELP
Are you sure, that you mean the elementwise multiplication and not a matrix multiplication? inv(J1) .* M % Elementwise multi...

12 dagar ago | 0

How can I fix this error and what does mean by should return 1 or two arguments help pls
Which userfcn do you provide? You have to insert changes there, so please post the code of your userfcn. It should start with ...

13 dagar ago | 0

| accepted

Test equivalence between mex and (.m) matlab functions
I store the compiled MEX functions in a specific folder. This is useful also to support different Matlab version, so each versio...

13 dagar ago | 1

| accepted

array of structs how to preallocate and assign
An easy way is to create the struct array backwards: sa = struct([]); for k = 3:-1:1 sa(k).a = k; sa(k).b = rand; e...

13 dagar ago | 0

Creating new arrays under conditions.
start = [5000, 7000, 12500, 14200, 19000]; stop = [4500, 8520, 14000, 14500, 21000]; keep = (abs(start - stop) >= 1000); n...

13 dagar ago | 1

| accepted

How can I run two loops at a time?
The error message means, that I1(i,j) is a scalar, but smooth(sum(ILP,2)) is not. You cannot assign an array to a scalar. Mayb...

13 dagar ago | 0

Automatically open new files as they appear in a folder
Under Windows this canbe done by .NET using a System.IO.FileSystemWatcher. But in general a simple timer is easier: % [UNTESTED...

13 dagar ago | 0

| accepted

Early exit instead of a warning in ODE113?
In the current version of Matlab ODE113 does stop, when the integration tolerance is not met. The warning is shown an the integr...

13 dagar ago | 0

Merge two saved figures in a single figure
The problem cannot be solved. "Figures" can contain a toolbar, a menubar, GUI elements like buttons and popup menus. If the 2 fi...

13 dagar ago | 0

| accepted

Invalid use of operator.
Replace for ii~=jj by if ii~=jj A for command must have the structure: for counter = a:b and the ~= operator is not allowe...

13 dagar ago | 0

| accepted

Error Index exceeds the number of array elements (0)
ind = find(segment < 0.5); lock(i) = ind1(ind(1)); If there is no element in segment, which is smaller than 0....

13 dagar ago | 0

| accepted

Find indice of floating point number in matrix
find() does not fail on floating point arrays. If a floating point array is provided, find replies the indices of all elements, ...

13 dagar ago | 0

| accepted

Building a custom image reader function in MATLAB to emulate in built functions like imread
It is nearly impossible to write any useful code in Matlab without using builtin functions. See https://www.mathworks.com/matlab...

13 dagar ago | 1

convert strings of multiple numbers into matrices
% Contents of the text file: % [[-0.4888 -0.4661 -0.7374 54.5679] % [-0.4835 0.8483 -0.2157 25.8953] % [ 0.7262 0.2511 -0...

13 dagar ago | 0

| accepted

How to open a .p file in matlab ?
You cannot "open" a P-file in a meaningful way. Modifications are not possible. If you want to change the code of a P-coded fun...

13 dagar ago | 0

Check if a script has been run during this session
Create your own function: function myActivate persistent called if isempty(called) activate(); caslled = true; end...

15 dagar ago | 1

Set Path's "Add with Subfolders" functionality
Create your own copy of genpath as mygenpath and insert e.g.: ... if ~strcmp( dirname,'.') && ... ~strcm...

16 dagar ago | 0

| accepted

Accessing Subfloders of Subfolders in MATLAB
BaseFolder = 'D:\Your\BaseFolder'; FileList = dir(fullfile(BaseFolder, '**', '*.xml')); for k = 1:numel(FileList) File =...

16 dagar ago | 0

| accepted

Solved

Calculate cosine without cos(x)
Solve cos(x). The use of the function cos() and sin() is not allowed.

17 dagar ago

How can I use the same script for multiple different matrix arrays at once?
% Move the set of variables to fields of a struct: NameList = sprintfc('Y%02d', 0:25); backcd= cd; cd(tempdir); save('dummy....

17 dagar ago | 0

How to draw a number of colors from custom colormap?
YourMap = rand(256, 3); % 14 color which exist in the original map: Map14 = YourMap(round(linspace(1, 256, 14)), :); % ...

17 dagar ago | 0

| accepted

Import STL file and convert to Matrix
What about using Matlab's STL import? https://www.mathworks.com/help/pde/ug/stl-file-import.html

17 dagar ago | 0

How to speed up saving data to .txt file?
fopen, prtintf or even better fwrite is much faster than the very smart writematrix. Appending requires to open the file and sea...

17 dagar ago | 0

Are Matlab Apps backwards compatible with previous versions
No, the apps are not backward compatible. The users of the apps do need all functions, which are needed by the apps.

17 dagar ago | 0

| accepted