Answered
How do I break axis to show data that have large variation?
Search in the FileExchange for "break axis": https://www.mathworks.com/matlabcentral/fileexchange?q=axis+break

4 years ago | 1

Answered
At least one END missing, yet I have written end
At least one bug is here: sum8 = sum8 + (exp(-(p(2) / p(3)) * (exp(p(3) * x(i)) - 1))) * ... (p(3) * x(i) * exp(p(3 * x(i)...

4 years ago | 0

| accepted

Answered
I had to reset my PC, matlab still running. After reboot Appdesigner can't open file properly. It seems to be running but blank window only appears..
Maybe the Matlab installation is damager (re-install) or just the preferences (re-create them by renaming the preferences folder...

4 years ago | 1

| accepted

Answered
the function can only take one input argument
Either modify the call to create the vector dynamically: analyzeT([28,44,50,33]) % ^ ^ Or create a new input...

4 years ago | 1

| accepted

Answered
How to auto run the slider using a button?
The shown code creates a figure programmatically. Using the AppDesigner would be useful to insert an element in a uifigure , whi...

4 years ago | 0

Answered
Using sendmail with gmail oauth2 credentials
I assume this helps: https://www.mathworks.com/matlabcentral/answers/1672544-using-gmail-after-may-30-2022

4 years ago | 0

| accepted

Answered
How to introduce a constraint and stop condition in ode45 ?
Both is done by an event function. There you can check the values of the current trajectory and stop the integration. If the val...

4 years ago | 1

Answered
How is the filter function algorithm implemented in MATLAB?
The code is shiown in the last paragraph. So you have posted a valid answer to your question already. You find a corresponding ...

4 years ago | 0

| accepted

Answered
imrotate3 gives me just zeros with 'linear'
I cannot confirm this, but it is even stranger: BW = rand(5, 5, 5) > 0.5; BW2 = imrotate3(BW, 45, [0, 1, 0], 'linear', 'crop'...

4 years ago | 0

| accepted

Answered
Enabling push button after an error occurred?
Matlab stops, when an error occurs. If it does not run anymore, it cannot modify buttons. The solution is to catch errors: try...

4 years ago | 0

| accepted

Answered
Can anyone knowledge me what is the meaning of this syntax?
Start with simplifying the code: S = stepinfo(ScopeData(:, 2), ScopeData(:, 1)); STime = S.SettlingTime; brig...

4 years ago | 0

Answered
Separate matrix each 3 columns and save outputs each iteration
With some bold guessing, what "different names" means (better mention, what you want): data = reshape(1:30*90, 30, 90); % So...

4 years ago | 0

| accepted

Answered
How to count the number of peaks from a graph with a certain threshold?
findpeaks will solve the problem: [PKS,LOCS] = findpeaks(Y, 'MinPeakHeight', yourThreshold) Maybe you use Y and X depending on...

4 years ago | 0

Answered
resampling of large dataset
SIGNALS(:,u)=signal; This let the array SIGNALS grow in each iteration. Therefore a new larger array must be created and the ol...

4 years ago | 0

Answered
Import data from text file with lines of unequal length as fast as possible.
Sorry, I'm not proud of this code, but it 23% faster on my machine for a test file with 6000 lines: filename = 'sample.txt' ; ...

4 years ago | 1

Answered
How to create a matrix through a nested loop?
x = 1:0.5:10.5; y = 1:0.5:10.5; speaker1pos = [4.7, 2.3]; speaker2pos = [8.6, 4.8]; L_w1 = rand; L_w2 = rand; for j = ...

4 years ago | 0

Answered
MATLAB unresponsive on startup
Try to recreate the preferences folder: C:\Users\<USERNAME>\AppData\Roaming\MathWorks\MATLAB\<VERSION> Rename this folder and ...

4 years ago | 0

Answered
Changing tick labels on x axis
This is pure voodoo: axisticks = ([-0.1:0.2:1.5]) cfg.xmin = ([min(axisticks)]) cfg.xmax = ([max(axisticks)]) cfg.xticks = (...

4 years ago | 1

| accepted

Answered
Align/intersect two vectors of different size and non-exact matches then trim the edges
Problem 2: A = [21 26 30.8 34.7 36 39.9]; limit = 3.9; match = true(size(A)); a = A(1); for k = 2:numel(A) if ...

4 years ago | 0

| accepted

Answered
Trying to use if to create a table
Remember, that the if condition must be a scalar. You provide a comparison of two vectors: if data.price(1:end-1)<data.price(2:...

4 years ago | 0

Answered
cell2mat command not giving expected result
There are no empty array in the provided data, but the sizes of the vectors differ: all are row vectors, but they have between 1...

4 years ago | 0

Answered
How can i use two variables while using eval command
If you really need different arrays, because the contents have different sizes, use a cell array: Utt = cell(10, 5); for i = 1...

4 years ago | 0

Answered
Updating many field values at once
F = fieldnames(data); for k = 1:numel(F) data.(F{k}) = data.(F{k})(updated_values); end

4 years ago | 0

| accepted

Answered
Can you please confirm whether 2022 version update_2 has the code fixes of 2022 version update_1
Yes, the updates are cumulative. The higher versions contains the changes of the lower versions also.

4 years ago | 1

| accepted

Answered
Wildcard file name matching with multiple dots on Windows
List = dir('*.txt.*') List = List(contains({List.name}, '.txt.'))

4 years ago | 0

Answered
ode23, too slow
Reading the files in each iteration is a very time-consuming method. Do this once only and store the values in a persistent vari...

4 years ago | 1

| accepted

Answered
Getting error in this code.
A simpler version - note that sqrt(x) is much cheaper than x^0.5: betasqr = 0.2; gamma = 0.3; psi = 0.001; mu = 1...

4 years ago | 1

| accepted

Answered
commands like hold on, hold off, grid on not working
Posting code is safer than paraphrasing what the code is expected to do. To be sure: Does this reproduce the problem: figure; ...

4 years ago | 0

Answered
compare every element in the first array with the second array
X = [1,3,5,9]; Y = [1,2,4,9]; Z = zeros(size(X)); for k = 1:numel(X) Z(k) = Y(find(Y >= X(k), 1)); end Z This doe...

4 years ago | 1

| accepted

Answered
Extract values from one field of structure, write into array
Why do you call str2double? What is the contents of the 'name' fields? What is the wanted output? Mentioning the type of inputs ...

4 years ago | 2

Load more