
Les Beckham
Many years developing flight control algorithms and software
C++, C, C#, MATLAB, Assembly
Estadísticas
2 Preguntas
318 Respuestas
0 Problemas
26 Soluciones
CLASIFICACIÓN
132
of 279.858
REPUTACIÓN
868
CONTRIBUCIONES
2 Preguntas
318 Respuestas
ACEPTACIÓN DE RESPUESTAS
50.0%
VOTOS RECIBIDOS
114
CLASIFICACIÓN
of 18.771
REPUTACIÓN
N/A
EVALUACIÓN MEDIA
0.00
CONTRIBUCIONES
0 Archivos
DESCARGAS
0
ALL TIME DESCARGAS
0
CLASIFICACIÓN
15.017
of 128.691
CONTRIBUCIONES
0 Problemas
26 Soluciones
PUNTUACIÓN
261
NÚMERO DE INSIGNIAS
1
CONTRIBUCIONES
0 Publicaciones
CONTRIBUCIONES
0 Público Canales
EVALUACIÓN MEDIA
CONTRIBUCIONES
0 Temas destacados
MEDIA DE ME GUSTA
Content Feed
Saving a struct to a text file exactly how it appears in command window
Here is one approach. path='F:\settings.txt'; settings = struct; %Create structure called settings % settings.exposure_...
5 días hace | 1
| aceptada
Click in the beginning and end of pure tone
Try adding ramps at the beginning and end to avoid the discontinuities of starting and stopping the tone. spl_rms = 60; spl_p0...
14 días hace | 0
| aceptada
My MATLAB code is showing blank plots instead of encrypted and decrypted images. Why? [Help]
You need to convert encryptedImage and decryptedImage back to uint8. This line is converting to double because SBox is double. ...
19 días hace | 0
| aceptada
normalization data to 0-255
format long g A = [linspace(1, 10, 10); flip(linspace(3, 100, 10)); rand(1,10)].'; T = array2table(A, 'VariableNames', {'ID', ...
26 días hace | 0
| aceptada
Plot line with custom color
This looks a bit jaggedy and dark here, but looks good in my desktop Matlab. If you had read the documentation for plot, you co...
26 días hace | 0
| aceptada
i keep getting this error: Error: Function definitions in a script must appear at the end of the file. Move all statements after the function definition to before the ...
You must have some code in your script after the last end that you didn't post. Make sure that the function definition is the v...
26 días hace | 0
Creating a rectangular patch using random numbers
The chances of four random points in 3d being coplanar are virtually zero. The chances of them forming a parallelogram are infi...
alrededor de 1 mes hace | 1
| aceptada
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parenthe
You are missing the multiplication operator in several places. For example: IndexImg((Orientation >= pi/8 & Orientation < pi/4...
alrededor de 1 mes hace | 0
| aceptada
Is there a MatLab online training course that teaches you how to create and use functions?
There is a module in the Matlab Fundamentals online training that concentrates on functions: https://matlabacademy.mathworks.co...
alrededor de 1 mes hace | 0
finding a numeric pattern in a vector
Note that I added an additional test at the end of vec to make sure this handles a multi-digit number in the middle position of ...
alrededor de 1 mes hace | 0
How to extract specific dates from a datetime table?
whos('-file', 'DATE1.mat') whos('-file', 'DATE2.mat') load('DATE1.mat') load('DATE2.mat') whos head(datet) head(B) found_...
alrededor de 1 mes hace | 1
| aceptada
How do I use xline() to plot values calculated in a for loop?
Your x is going to be symbolic based on the code you posted (you can verify this by using the whos in the Command Window or by l...
alrededor de 1 mes hace | 0
| aceptada
What is the previous syntax for this function?
The strcat function has been around for a long time. strcat("Hello", "World")
alrededor de 1 mes hace | 0
| aceptada
output of two function results
You need to provide two output variables when you call the function. Note that the names you use when you call the function don...
alrededor de 1 mes hace | 1
Why are values not rotated?
P = [1 2]*10^7; % made up data to test with S = [1 2; 2 3]; T = [0 70; 0 100]; plot(S(1,:),T(1,:), S(2,:), T(2,:...
alrededor de 1 mes hace | 0
Calculate the temperature distr
First of all, format your code (type Ctrl-A then Ctrl-I) in the Matlab editor. Second, add more comments. For example, is m ...
alrededor de 1 mes hace | 0
| aceptada
Factorial using a for loop
Your code works fine (though I would add semicolons to the end of all lines except the for and end to avoid spewing a bunch of s...
alrededor de 1 mes hace | 2
read several csv files with space in the name format
i = 1; filename2 = strcat('opt.w.matrix.reg. ',int2str(i),'.csv') As you have seen, strcat strips leading and trailing spaces....
alrededor de 2 meses hace | 0
| aceptada
remove decimals from title when using sprintf
Q=2021; %year x = 0:10; y = x.^2; plot(x,y) grid on title(sprintf('text %d',Q)) % <<< replace %f with %d
alrededor de 2 meses hace | 0
| aceptada
Error using .^ not enough input arguments
Perhaps you meant this instead % L = integral( sqrt(1+{power(dy/dx),2}),x1,x2); % ^ ^ remove...
alrededor de 2 meses hace | 0
| aceptada
Most readable syntax to fill table in a for cycle
There probably isn't a significantly cleaner way to do this. See below for a way to suppress the warnings. format short e x =...
alrededor de 2 meses hace | 0
| aceptada
How do i do x1<=x<=x2 in matlab?
You have to split up the compound condition into two conditions: (x1 <= x) && (x <= x2) If these terms are scalars, that will ...
alrededor de 2 meses hace | 0
| aceptada
Formatting read data from text files
text_data = fileread('Question.txt'); disp(text_data)
alrededor de 2 meses hace | 1
| aceptada
How can I save an animated plot as a GIF?
Check the answer to this question: https://www.mathworks.com/matlabcentral/answers/94495-how-can-i-create-animated-gif-images-i...
alrededor de 2 meses hace | 0
animated sine wave continously
This should get you started. Adjust as desired. Note that the animation won't show here, but I tested it my local copy of Matl...
alrededor de 2 meses hace | 0
| aceptada
saving workspace variables individually?
a = 1; b = 2; c = 3; vars = who for v = 1:numel(vars) save(sprintf('%s.mat', vars{v}), vars{v}) end dir
2 meses hace | 0
| aceptada
Color in plot from Table
Just a couple of issues. You need column vectors to insert into the table, and you can only have a scalar string or char vector...
2 meses hace | 0
Convert C code to Matlab code for reading binary file
Your Matlab struct doesn't match the definition in the C code. For example, the third element is a char array of 100x1000 in th...
2 meses hace | 0
Saving a structure array, not fields of it
s1 = struct('a', 1, 'b', 2') save('s1.mat', 's1') % don't use the '-struct' option clearvars whos load('s1.mat') whos Anot...
2 meses hace | 0
| aceptada
Find column number for every row in matrix
A = [ -1 4 1 1 -1 -1 -5 4 -1 ]; [row, col] = find(A > 0) [~,idx,~] = unique(row, 'first...
2 meses hace | 0