Respondida
GUI app callback functions problem
I'm not sure if I understand, where in the code the problem occurs. Waiting for a figure to be closed is done by the waitfor fun...

más de 3 años hace | 1

| aceptada

Respondida
Find the desired row in the matrix
While removing multiple rows is easy using the unique(x, 'rows'), I did not find a built-in functions to identify the vectors, w...

más de 3 años hace | 1

| aceptada

Respondida
sort each row of a vector according to its value
You do not need a function, because this is staight indexing: a = [1 3 10 5]'; b(a) = a b must be undefined or empty before t...

más de 3 años hace | 1

| aceptada

Respondida
Solve the ODE using ODE45 and plot the response for the initial conditions
If you call a function "ode45", it depends on where its folder is located in Matlab's path, if it is used or the original ODE45 ...

más de 3 años hace | 0

Respondida
Please ask the code
You overwrite the value of m multiple times: m=3; m=0.1; m = linspace(0,0.001); Because projfun is a nested function, it use...

más de 3 años hace | 0

Respondida
Ignore rows in cell with no delimiters
You want the output: B = {a1} {1} {a2} {2} {a3} {3} {a4} {a5} {a6} {6} This is not possible. A cell matrix is still a m...

más de 3 años hace | 0

Respondida
How to create for and if loops instead of while
WHILE and FOR loops are equivalent: k = 1; while k <= 100 ... k = k + 1; end and for k = 1:100 ... end

más de 3 años hace | 0

| aceptada

Respondida
How does a line plot handle data larger than the axes size?
This was answered some years ago: https://www.mathworks.com/matlabcentral/answers/252979-increase-the-plotting-performance-in-th...

más de 3 años hace | 1

| aceptada

Respondida
what is the problem in this convolutional code
There is another problem before: % rate 1/2 convolutional encoder % define trellis trellis = poly2trellis(7,[111 111]); %...

más de 3 años hace | 0

Respondida
how to find a line perpendicular to another line?
% 2 points to define a line: X = [126.3798 126.3818]; Y = [37.5517 37.5495]; % Its direction: v = [diff(X); diff(Y)]; n =...

más de 3 años hace | 0

| aceptada

Respondida
How to normalize stereo audio?
signal = signal ./ max(abs(Signal), [], 1);

más de 3 años hace | 0

Respondida
Alternative ways to generate a structure from strings without using eval?
"I want to build an internal structure in a data/string driven way." - This is the design error already. Why did you decide for ...

más de 3 años hace | 1

Respondida
Changing the Reading of Files in a For Loop
This is a job for Stephen's https://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sort or https://ww...

más de 3 años hace | 0

| aceptada

Respondida
fopen always open the file even when it is already open
"fopen is supposed to return -1 when it can't open the file" - correct, this is the defined behavior. "So I thought when I had ...

más de 3 años hace | 0

| aceptada

Respondida
Find duplicate elements and remove the rows that has similar values in one column
Avoid iteratively growing arrays, because they are extremly expensive. See: x = []; for k = 1:1e6 x(k) = rand; end This...

más de 3 años hace | 1

| aceptada

Respondida
Reading data from a different URL each iteration
F = "https://lgdc.uml.edu/common/DIDBGetValues?ursiCode=JI91J&charName=foF2,foF1,foE,foEs,hmF2,hmF1,hmE" + ... "&DMUF=3000&...

más de 3 años hace | 0

| aceptada

Respondida
Creating a DFT without built in function
p = 0; for k = 0:1:N-1 p = xn * exp(2*pi*-1i*n*k/N); end This overwrites p N times. Should this be a sum? If xn is a ve...

más de 3 años hace | 0

Respondida
remove and replace text in a .dat file
You cannot replace a line in a text file on the disk directly, because the new text might have another number of characters than...

más de 3 años hace | 0

| aceptada

Respondida
Beginner: How do I loop through strings ?
This is the question asked most frequently by beginners. The answer of the experts is always the same: Don't do this. This is e...

más de 3 años hace | 0

| aceptada

Respondida
Load different files from folders
Do the .xmp files have the same name as the .csv files? Do all .csv files inside the base folder belong to the measurements? The...

más de 3 años hace | 0

| aceptada

Respondida
design filter to implement in microcontroller
You find C code implementation of filter() here: https://www.mathworks.com/matlabcentral/fileexchange/32261-filterm As M code: ...

más de 3 años hace | 0

Respondida
Convert cell to matrix
C = {'00000000', '00000010', '00000011'}; D = cat(1, C{:}); % Convert to matrix of type CHAR E = D - '0' % Convert to ...

más de 3 años hace | 0

| aceptada

Respondida
Writing commands in MATLAB
No, this will not work. Since R2009a Matlab is case-sensitive even under Windows. You cannot call sin() using the name SIN(). B...

más de 3 años hace | 1

Respondida
sprintf into a number
Stephen an Walter hit the point. % Store imported data in an array instead of polluting the workspace: FileData = load('YourIn...

más de 3 años hace | 0

| aceptada

Respondida
How can I rotate a 3d figure with the rotation matrix without using functions?
In a matrix multiplication the length of the row of the first matrix must equal the length of the column of the second one. In ...

más de 3 años hace | 0

| aceptada

Respondida
for loop to sum values
what about the answer given to your similar question: https://www.mathworks.com/matlabcentral/answers/1826808-sum-of-values-in-m...

más de 3 años hace | 0

Respondida
sum of values in matrix with a loop
outDates = rand(52560, 8); % Arbitrary test data X = reshape(outDates(:, 6:8), 144, [], 3); Y = squeeze(sum(X, 2) / size(X, 2...

más de 3 años hace | 0

Respondida
How do I save image in folder using imrite and how do I show all the image in folder?
Maybe you want to create the file name dynamically: ... outFile = fullfile(path_directory, sprintf('fcmgrayb245_73_864_rap%05d...

más de 3 años hace | 0

Respondida
How do I create a for loop for the this example?
The solution is easy, if you do not hide the index in the name of the variable as in i_end_cd1, i_end_cd2, ... Use a vector inst...

más de 3 años hace | 0

| aceptada

Respondida
I get Arrays have incompatible sizes for this operation with an elseif statement what do i do?
The == operator compare the arrays elementwise. Therefore the arrays on the left and right must have the same number of characte...

más de 3 años hace | 0

| aceptada

Cargar más