Beantwortet
Rename Struct Fields Old Function
Try this C-Mex verions: https://www.mathworks.com/matlabcentral/fileexchange/28516-renamefield An M-version is included also....

etwa 4 Jahre vor | 0

Beantwortet
How do I rename fields of a structure array?
Although this thread is old, it has a lot of views and it is worth to mention this implementation as fast C-Mex: https://www.ma...

etwa 4 Jahre vor | 0

Beantwortet
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...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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? ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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

etwa 4 Jahre vor | 1

Beantwortet
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)...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 0

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

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 1

Beantwortet
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 ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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'...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 0

Beantwortet
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...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 4 Jahre vor | 0

Beantwortet
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...

etwa 4 Jahre vor | 0

Beantwortet
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' ; ...

etwa 4 Jahre vor | 1

Beantwortet
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 = ...

etwa 4 Jahre vor | 0

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

etwa 4 Jahre vor | 0

Beantwortet
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 = (...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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:...

etwa 4 Jahre vor | 0

Beantwortet
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...

etwa 4 Jahre vor | 0

Beantwortet
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...

etwa 4 Jahre vor | 0

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

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
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.

etwa 4 Jahre vor | 1

| akzeptiert

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

etwa 4 Jahre vor | 0

Mehr laden