Answered
Cell array multiplication error
The error message means, that either B or r_prob is not a cell array. Use the debugger to find out, what type it is instead. Typ...

22 days ago | 0

| accepted

Answered
Groupcount function sort data in alphabetical order
% groupcounts sorts the input: C = {'C', 'C', 'C', 'A', 'A', 'E', 'E', 'E', 'E', 'B'}.'; [N, EVENTS] = groupcounts(C) % Let...

22 days ago | 0

| accepted

Answered
It is possible to run a script when you put a courson on a graph?
Of course this works. It depends on what exactly "put a coursor" means. Moving the mouse over the obejct? Clicking on the line? ...

22 days ago | 0

| accepted

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

22 days 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)...

22 days 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...

23 days 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...

23 days 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...

23 days 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

23 days ago | 0

| accepted

Answered
How to introduce a constriant 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...

23 days 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 ...

23 days 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'...

23 days 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...

24 days 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...

24 days 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...

24 days 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...

24 days 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...

24 days 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' ; ...

24 days 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 = ...

24 days 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 ...

25 days 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 = (...

25 days 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 ...

25 days 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:...

26 days 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...

26 days 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...

26 days 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

28 days 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.

28 days ago | 1

| accepted

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

28 days 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...

28 days 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...

28 days ago | 1

| accepted

Load more