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

etwa 4 Jahre vor | 1

| akzeptiert

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

etwa 4 Jahre vor | 1

| akzeptiert

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

etwa 4 Jahre vor | 0

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

etwa 4 Jahre vor | 1

| akzeptiert

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

etwa 4 Jahre vor | 2

Beantwortet
Delete all repeatation number
% Your code repeat=[2;6]; a = [1 2 2 3 2 4 5 6 7 8 6] for i=1:length(repeat) a(a==a(repeat(i)))=[] end A small modifica...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How can I recover a accidentally deleted object from GUI_file?
I assume, this is an effect of: imshow(I) As a high-level graphics command (as e.g. plot()), imshow removes all former childre...

etwa 4 Jahre vor | 0

Beantwortet
Delete all repeatation number
a = [1 2 2 3 2 4 5 6 7 8 6]; [S, idx] = sort(a(:).'); m = [false, diff(S) == 0]; ini = strfind(m, [false, true]...

etwa 4 Jahre vor | 0

Beantwortet
How to plot 2 figures with 2 subplots each ?
Fig1H = figure; Ax1H = subplot(Fig1H, 1, 2, 1); plot(Ax1H, rand(10)); Ax2H = subplot(Fig1H, 1, 2, 1); plot(Ax2H, rand(10))...

etwa 4 Jahre vor | 0

Beantwortet
Match two rows value by a column value
index1= strcmp(new_data(:,34),'1', new_data(:,9),'Corn'); This is gun-shot-programming. Please read the documentation of strcmp...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
jpeg_read Can't open file error
Work with absolute path names. 'dataset/controlled/FB/QF-50/original-041-1012x1800.jpg' does not include the folder '/home/bojan...

etwa 4 Jahre vor | 0

Beantwortet
how to save signals in sequence of numbers in '.mat' form?
for k = 1:20 ... filename = sprintf('Annotation%02d.mat', k) save(filename, ...) end This creates Annotatio...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Concatenate str and int and store it as a vector
A = [761,2,45,65,900]; B = [56,96,368,879,56]; s = 'sample'; sprintfc([s, '_%d_%d'], [A; B].') % Or: compose('sample_%d_%d'...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Copy files based on presence in list
What exactly are "duplicates"? Which of them should be used? What does "removing" mean: from the list or delete the files? List...

etwa 4 Jahre vor | 0

Beantwortet
string for x label in a plot
It is not really clear, what you are asking for. But you can set the XTicks and the corresponding lables freely. x = 1:15; y =...

etwa 4 Jahre vor | 1

Beantwortet
concat/horzcat for cell with data cells of a*b*c sizes
E1m = reshape(E1, 180, []); E2m = reshape(E2, 180, []); E = cat(2, E1m, E2m); cat(2, ...) is the same as horzcat().

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to add multiplicative noise to audio?
According to the name "multiplicative noise" I'd expect this to work also: t = linspace(0, 5, 5 * 1000); yourSound = s...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How do I split a string using a only *single* whitespace delimiter so any multiple whitespaces are also "split"?
The dull method: s = 'Time Aero Inertial Total'; d = diff(s == ' '); s(d == -1) = '*'; % Start of non-spaces ...

etwa 4 Jahre vor | 0

Beantwortet
I don't understand my error
y = @(Ta) -139.34411 + 1.575701e5 ./ Ta - 6.642308e7 ./ Ta.^2 + 1.243800e10 ./ Ta.^3 - ... 8.621949e11 ./ Ta.^4 - Y; g = d...

etwa 4 Jahre vor | 0

Beantwortet
How do I change the axis exponent of several subplots at once?
arrayfun(@(axH) set(axH.YAxis, 'Exponent', 3), findobj(gcf,'Type','axes')) Alternatively: AxesH = findobj(gcf,'Type','axes'); ...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
Cannot find an exact (case-sensitive) match for 'RRRproject3' !!!
The message is clear. Matlab is case-sensitive. The function call "RRRproject3()" cannot be found, but there is a function calle...

etwa 4 Jahre vor | 0

Beantwortet
How does seperate script tell compiled GUI its done
The solution is trivial: Just add some code to show the progress. Your code was fine and efficient: app.ProgressField.Value = "...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Integral as part of a function
% As anonymous function: f = @(x) integral(@(t) 2 * sqrt(0.0625 - t.^2), -0.25, x - 0.25) / 0.0981747704247; f(13) % As funct...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
How can I split a cell that contains two different cells and store them with two different names?
Your example does not need a FOR loop, but the solution is trivial: A = {{55 55 44; 44 66 22} {44 22 00; 82 65 12}}; B1 = A{1...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Can you help me draw the plot with decimals?
I1(i/n) = ... This cannot work. i/n is not an integer and therefore not possible as index. Remember what indices are: X(k) ...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Is it possible to go through the elements of an array without resorting to length in a for loop?
Yes, this works: a = [1,2,3]; for i = a if i > 2 fprintf('%d is greater than 2\n', i) end end Notes: It ...

etwa 4 Jahre vor | 2

Beantwortet
calculating the mean for each column in a numerical array based on the elements in column 1
With a simple loop: A = [randi([1, 198], 8167, 1), rand(8167, 10)]; result = zeros(198, 11); for k = 1:198 match ...

etwa 4 Jahre vor | 1

| akzeptiert

Beantwortet
why I can't work with the optimization Toolbox?
ver tells you, if the toolbox is installed. This shows, if you have an active license for this toolbox: license('test', 'Optimi...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
Logical indexing cell array
A hint: I takes some time to create your input data such, that it can be used in an example. Please do such tedious editing by y...

etwa 4 Jahre vor | 0

| akzeptiert

Beantwortet
how I can create matrix of amout of fun after for loop ???
Maybe you mean: na = 10; a = linspace(-5,5,na); b = [-3 -1 2 3 4]; nb = numel(b); options = optimoptions('ga','Display','...

etwa 4 Jahre vor | 0

| akzeptiert

Mehr laden