Respondida
Matlab GUI elements disappear on newer version of Matlab
The uibuttongroup hides objects, which have been created before in modern Matlab versions. Set a position of the uibuttongroup'...

más de 3 años hace | 0

| aceptada

Respondida
Identify lines that have a repetition (unique function)
data = [ 2.3300000e+02 3.5300000e+02 1.4912281e+00 2.3300000e+02 3.5200000e+02 1.4912281e+00 3.5300000e+0...

más de 3 años hace | 0

Respondida
How Do I Replace Numbers with Alphabets
The solution is trivial: Simply write it down using CHAR vectors (not strings, which are enclosed in double quotes): n = 'ABCDE...

más de 3 años hace | 1

Respondida
Matlab energy consumption greater than charger?
This is not a problem of Matlab, but your powersupply is too weak. Is it the original one delivered with the laptop? If so, it m...

más de 3 años hace | 0

Respondida
addPath does not take a vector from genpath
According to the documentation https://www.mathworks.com/help/matlab/ref/matlab.project.project.addpath.html addPath() takes one...

más de 3 años hace | 0

| aceptada

Respondida
How to rotate this 2d matrix with some angle ?
To define a rotation matrix, you need one angle in 2D (rotation around the Z axis) one angle and an axis of rotation in 3D on...

más de 3 años hace | 1

Respondida
mask a matrix based on values in two arrays
n = 1e4; u = floor(rand(10,1)*100); v = floor(rand(10,1)*100); tic % Original version: [x y] = meshgrid(linspace(0, 100, ...

más de 3 años hace | 0

| aceptada

Respondida
Do not use the for loop to calculate the first number greater than 0 in each line
x = randn(10, 10) y = x.'; % Required for the last step y(y3==1) y1 = y > 0 y2 = cumsum(y1) % Now a row can contain mult...

más de 3 años hace | 1

| aceptada

Respondida
fprintf with complex numbers and ordinary arrays
This does not work without a loop. fprintf(' iteration number root estimates\n'); for k = 1:n fprintf('%10.0...

más de 3 años hace | 1

| aceptada

Respondida
What is the fastest way to export a large matrix of numbers from MATLAB to Excel (preferably as .xlsx) ?
Simply try it: M = magic(10^3); tic; writematrix(M, 'file1.xlsx'); toc tic; writecell(num2cell(M), 'file2.xlsx'); toc ...

más de 3 años hace | 1

| aceptada

Respondida
All is correct but this code gives error?
I guess boldly, that the code fails here: [pop(i,:),fxi(i,1)]=fminsearch(fitnessfun,pop(i,:),options,varargin{:}); ... fxi=fe...

más de 3 años hace | 0

Respondida
How do I insert a picture into a script?
It depends on how you would like to see the image. It cannot be displayed in the editor, because scripts are M-files and therefo...

más de 3 años hace | 0

Respondida
Downsampled data exceeds the input data
A linear interpolation avoids output points outside the range of input point. Use interp1 or the modern and faster griddedInterp...

más de 3 años hace | 0

Respondida
A very fast way to (i) concatenate and (ii) calculate the difference of elements?
a1 = datetime([ '2022-10-27 00:22:50.000' '2022-10-27 05:29:45.000' '2022-10-27 05:32:19.400' '2022-10-27 05:36:...

más de 3 años hace | 1

| aceptada

Respondida
Opening multiple instances of MATLAB causes endless folder access errors
What about allowing Matlab to access your documents folder?

más de 3 años hace | 0

Respondida
title subplots within a for loop
Avoid the overkill of hold on commands. One per subplot is sufficient. What is the purpose of the "ll" here: title(ll,"(m)") ...

más de 3 años hace | 0

Respondida
Same code taking 15x longer to execute on a faster machine
n = 32000; % 7362497; dE00 = zeros(6, n,"single"); lab_NF = rand(6, 3, 'single'); labDB = rand(n, 3, 'single'); tic fo...

más de 3 años hace | 1

| aceptada

Respondida
why does it has to be tedious to produce high quality figures for (academic) publications using MATLAB? (open Discussion)
My trivial answer: This is the nature of "high quality figures". Depending on the journal you are publishing in different proper...

más de 3 años hace | 0

Respondida
Converting cell to array data with specific string
data = {'[2, 11, 5, 0] '; '[1, 10, 6, 0] '; '[9, 3, 6, 0] '}; value = str2num(sprintf('%s;', data{:})) Internally str2num is ...

más de 3 años hace | 0

Respondida
How to use nested FOR loop to create a matrix of answers?
thetaL = 3:3:90; VsL = 10:10:60; ... Other constants Result = NaN(numel(thetaL), numel(VsL)); for itheta = 1:numel(thetaL) ...

más de 3 años hace | 0

| aceptada

Respondida
How to merge very close bins in histogram/hiscounts
You can use FileExchange: RunLength to find the longest blocks of missing data: [b, n] = RunLength(x); match = (b == 0 & n > ...

más de 3 años hace | 1

| aceptada

Respondida
How to permanently disable warnings in MATLAB editor?
You can disable the MLint warnings directly in the editor with a right click on the concerned command: The disabling can concern...

más de 3 años hace | 1

Respondida
How do I find slope for large dataset?
The command gradient(x, t) solves this similar to diff(x) ./ diff(t), but with using the 2-sided difference except for the margi...

más de 3 años hace | 1

Respondida
Error using plot Vectors must be the same length.
[x, y2] = lab_8_method_2(@lab_8, 0.3, [0 1], 0.01); plot(x, y2 ,'r'); hold on; [x, y4] = lab_8_method_4(@lab_8, 0.3, [0 1], ...

más de 3 años hace | 0

Respondida
Find a number and range of group of the same number
With FileExchange: RunLength : a = [1 1 1 1 1 1 1 2 2 2 2 3 3 3 3 1 1 2 2 1 1 3 3 3 3 3 1 1 1 2 2 2]; [b, n, idx] = RunLength(...

más de 3 años hace | 1

Respondida
Hi ,I need some help with this PSO optimization code, "not enough input arguments "error message (Main pso used is The yarpiz's).
I'm not sure what you are asking for, but this is simplified version of your function without a loop: function Y1 = costfunctio...

más de 3 años hace | 0

Respondida
MEX func Error:"requires medical imaging toolbox" in Matlab R2022b
This seems to be an effect of Matlab's method to check, if you have a license for the used functions. This prevents the user fro...

más de 3 años hace | 0

Respondida
what happens with Matlab running training if my laptop eventually restarts for windows updates?
"I am scared if my laptop gets restarted automatically then I have to start the training all again" - if your code does not save...

más de 3 años hace | 0

| aceptada

Respondida
Why " The boundary condition function BCFUN should return a column vector of length 5" error message is came?
You provide an extra parameter: solinit = bvpinit(linspace(0,1),[0;3;1;1],2); % ^ here...

más de 3 años hace | 0

| aceptada

Respondida
Table column of strings to a matrix.
A = ["[0 0 0 0 0 0 0 0]";"[0 0 0 0 0 0 0 0]";"[0 0 0 0 0 0 0 0]";"[1 1 1 1 1 1 1 1]"]; AC = char(A); AC(ismember(AC, '[] ')) =...

más de 3 años hace | 1

Cargar más