답변 있음
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...

3년 초과 전 | 0

답변 있음
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...

3년 초과 전 | 0

답변 있음
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

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 1

| 수락됨

답변 있음
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]); %...

3년 초과 전 | 0

답변 있음
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 =...

3년 초과 전 | 0

| 수락됨

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

3년 초과 전 | 0

답변 있음
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 ...

3년 초과 전 | 1

답변 있음
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...

3년 초과 전 | 0

| 수락됨

답변 있음
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 ...

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 1

| 수락됨

답변 있음
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&...

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 0

답변 있음
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...

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 0

| 수락됨

답변 있음
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: ...

3년 초과 전 | 0

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

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 1

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

3년 초과 전 | 0

| 수락됨

답변 있음
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 ...

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 0

답변 있음
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...

3년 초과 전 | 0

답변 있음
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...

3년 초과 전 | 0

답변 있음
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...

3년 초과 전 | 0

| 수락됨

답변 있음
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...

3년 초과 전 | 0

| 수락됨

답변 있음
How to assign a value to a variable in for loop?
This is the most frequently asked question from beginners. Professional programmers give the simple and not expected answer: Don...

3년 초과 전 | 0

| 수락됨

답변 있음
How to save all the images generated from the for loop?
Remove the line f=figure; at the bottom of the loop, but open a new figure on top: for i=1:length(fileList) FigH = =figu...

3년 초과 전 | 0

| 수락됨

답변 있음
Proper if/else statement in appdesigner
Ref = app.rr_camber_ref.Value; Value = app.rr_camber.Value; if abs(Value - Ref) / abs(Ref) < 0.05 app.Lamp_rr_camber.Co...

3년 초과 전 | 1

| 수락됨

답변 있음
How do I change the font type in the axes?
Ax1H = subplot(1,2,1); Ax1H.FontName = 'Serif'; Ax1H.FontSize = 15; Ax2H = subplot(1,2,2); Ax2H.FontName = 'SansSerif'; Ax2...

3년 초과 전 | 0

더 보기