Beantwortet
How to extract N array from a for loop?
The question is not really clear to me. With some guessing: a = cell(1, 2); % Pre-allocate for i = 1:2 x = input('ent...

mehr als 4 Jahre vor | 1

Beantwortet
How to solve second order coupled ODEs with bvp4c?
function dy = YourODE(t, y) k = 17; dy = [y(3); ... y(4); k * y(1) * y(2); ... k * y(1) * y(2)]; end I...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
i want to solve that system using 4 order kutta method
The output is a simple point at [0, 0]. You start at 0. Then the expression x2/(x2/20) + 1 is NaN, because you divide by 0: x2...

mehr als 4 Jahre vor | 2

| akzeptiert

Beantwortet
repmat usage for cellarray
If this is what you want: cell_array = PG01 PG02 PG03 . . . PG32 PG01 PG02 PG03 . . . PG32 . . ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
GA optimisation how to find maxima instad of minima.
(The only way I found is to put a minus in the y(1) equation.) This is the perfect solution already.

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to make uicontrol edit box only show the text when needed?
You can simply delete the 'String' property of the text box, when the checkbox is disabled and store the contents e.g. in the Us...

mehr als 4 Jahre vor | 0

Beantwortet
solving second order differential equation using ode45
Convert the 2nd order equation into a set of 1st order equations: dy(1) = y(2); dy(2) = (1 - y(1)^2) * y(2) - y(1); See: http...

mehr als 4 Jahre vor | 0

Beantwortet
Problem with RC5 Image encryption
For images, "plain text" means the sequence of bytes. Import the image file by fopen&fread(fid, Inf, '*uint8'), not by imread()....

mehr als 4 Jahre vor | 0

Beantwortet
Is is possible to leave the dialog box created with inputs open after clicking ok?
Yes. Simply create a dialog box which have an "Apply" button. That "Ok" closes the dialog is the standard look&feel, so changing...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Turning a sequence of operations into a function
Start with simplifying the code: k is i+1 in all cases, so omit k and use i+1. Pre-allocate f1 by zeros() to avoid n iterative...

mehr als 4 Jahre vor | 0

Beantwortet
Getting the 3 lowest values in a vector Matlab
a = [12,3,9, 5.6, 9, 10, 7]; b = mink(a, 3)

mehr als 4 Jahre vor | 0

Beantwortet
How can i perform for loop in this case?
x = rand(51, 1); M = repmat(x, 1, 71, 3); size(M)

mehr als 4 Jahre vor | 0

Beantwortet
While loop to find index of first element to be less than and greater than in a vector
It is impossible, that a number is smaller than 0.42 and greater than 0.52: a(n) < 0.42 && a(n) > 0.52 % ^ ^ ...

mehr als 4 Jahre vor | 0

Beantwortet
Trying to fix the loop
nFail = 0; for n = 1:5 Vehicle_Type = input('Enter the Vehicle Type', 's'); switch lower(Vehicle_Type) case 'co...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Aligning numbers with text in a table
% 13 characters and aligned to the right: fprintf('%13s %13s %13s %13s \n', 'a', 'yes','async','asychronous'); % 13 characters...

mehr als 4 Jahre vor | 1

| akzeptiert

Beantwortet
not enough input arguments( not what you think)
"its says x=x0 in line 6 but this specific data is not in line 6" This means, that you do not call the function you think you a...

mehr als 4 Jahre vor | 0

Beantwortet
What changes are needed to run the code
ODE = @(x,y) [ ... y(2); ... y(3); ... (A.*(y(2)+0.5*x*y(3)) - y(1)*y(3) + y(2)*( y(2)+M^2*(sin(Psi))^2) - L1*y(4...

mehr als 4 Jahre vor | 0

Beantwortet
image encryption using rc4 : error in bitxor
You instruct PRGA to reply 128 values: Cipher = uint8(PRGA(KSA(key), size(original,2))); I assume you want: Cipher = uint8(PR...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Modify drawnow limitrate to update only 10 frames per second.
figure; axes('NextPlot', 'add'); tic; while 1 plot(rand, rand) if toc > 0.1 drawnow; tic; end end ...

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
How to generate images of binary random speckle patterns
This topic is discussed frequently here: https://www.mathworks.com/matlabcentral/answers/?term=tag%3A%22circle+packing%22

mehr als 4 Jahre vor | 0

Beantwortet
I am getting error says parse error
I guess, that the line before is the problem: options = Remember to append a ... as line continuation. This is no valid Matla...

mehr als 4 Jahre vor | 0

Beantwortet
How can I change the order of an N-dimensional array?
X = permute(X, [3,1,2,4]);

mehr als 4 Jahre vor | 0

| akzeptiert

Beantwortet
Line plot not showing up in for loop iteration
What exactly is trhe problem with your code? Maybe all you need is to insert a drawnow command after the plotting? By the way,...

fast 5 Jahre vor | 0

Beantwortet
Printing the entire array row in Matlab
a = [12,3,4,5]; b = [4,5,12,3]; fprintf('a: [%s]\n', join(string(a), ',')); fprintf('b: [%s]\n', join(string(b), ','));

fast 5 Jahre vor | 8

Beantwortet
how I create improved lorenz code
The test contains cos(dt), but your code only cos(t).

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
Unrecognized function or variable 'setupgraph'
You have mentiones the source of the dijkstra function in your other thread: https://www.mathworks.com/matlabcentral/fileexchang...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
find if one number is member of a column ,of cell array, that contains cell entries and if it is member, in which row, it appears
Simplify the data representation at first: for k = 1:size(C, 1) C{k, 5} = [C{k, 5}{:}]; end Then the searching is easy: ...

fast 5 Jahre vor | 0

| akzeptiert

Beantwortet
function handle specify in matlabfcn function
According to the documentation doc matlabfcn : =matlabfcn("quadgk(@(x) x.^2)", M3, M4)

fast 5 Jahre vor | 0

Beantwortet
Define matrix function to output matrix
A = rand(3); fumn(A, @sqrt) fumn(A, @(x) 1 ./ x) fumn(A, @(x) exp(-x)) function f = fumn(A, fcn) f = fcn(A); end

fast 5 Jahre vor | 0

Beantwortet
Reducing the running time of a for loop iterating through cells
Is C pre-allocated? Why do you use square brackets? This is the concatenation operator in Matlab. As far as I understand the us...

fast 5 Jahre vor | 0

Mehr laden