Community Profile

photo

Les Beckham


Last seen: 1 dag ago Active since 2013

Many years developing flight control algorithms and software

Programming Languages:
C

Statistics

All
  • MATLAB Central Treasure Hunt Finisher
  • Knowledgeable Level 4
  • First Review
  • 6 Month Streak
  • Thankful Level 1
  • First Answer
  • Solver

View badges

Content Feed

View by

Answered
help on graph (w/o common matrix plotting built-in functions)
In that case, maybe something like this will get you close. A = randi(2,10,365)-1; x = 1:size(A,2); y = size(A,1):-1:1; for ...

5 dagen ago | 0

| accepted

Answered
help on graph (w/o common matrix plotting built-in functions)
A = randi(2,10,365)-1 str = repmat(' ', size(A)); str(A==1) = '-'; disp(str)

5 dagen ago | 1

Answered
Reveresing the order of columns in an array
% Note: use semicolons instead of commas for row breaks so you get 4 columns q = [1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 16; 17...

8 dagen ago | 0

Answered
Recognise specific pattern in timetable
One approach without requiring the Signal Processing Toolbox: load('answers.mat') % an approximation of your data x = data(:,1...

15 dagen ago | 0

Answered
Extracting 2 Far right characters
One approach that generates a cell array: tt= {'United Kingdom TR';'United Kingdom SR';'United Kingdom WR';'Worldwide TC'}; c ...

19 dagen ago | 0

Answered
How to Rescale X Axis in Plot
Since you didn't show the code you used to generate the plot or include the data, I'll have to guess what the problem might be. ...

22 dagen ago | 0

| accepted

Answered
'Replace' shortcut in editor for R2022
Ctrl-H

ongeveer een maand ago | 1

| accepted

Answered
calculate time from alarm (variabel x) to event (variable y)
Try this t = [0;10;20;30;40;50;60;70;80;90;100]; % in sec; variables are generated every 10 seconds alarm = [0;0;1;0;1;0;0;1;...

ongeveer een maand ago | 0

| accepted

Answered
Read txt file with no header
This should work for any number of columns and it automatically detects the number of header rows and the variable names. t = r...

ongeveer een maand ago | 1

| accepted

Answered
How do I resolve these two lines separately?
Another approach B=rand(3,5) A=[0 0 0 1 0;1 1 1 0 0;1 0 1 1 0] idx = B > 0.6 A(idx) = ~A(idx)

ongeveer een maand ago | 1

Answered
Count number of words per row in a string
In 2020b or later you can also use a pattern with a regex pattern to find (and count) words. It took some experimenting to get ...

ongeveer een maand ago | 0

Answered
Can yous tell me this block in Simulink
That looks like the XY Graph block, perhaps. It normally isn't orange, however.

ongeveer een maand ago | 0

Answered
Calculating u and v components from wind direction and speed
Actually, it is straightforward. v (North (y) component) and u (East (x) component) can be calculated from S (wind speed) and D...

ongeveer een maand ago | 0

| accepted

Answered
How do I calculate the acceleration using only 3D distances?
load acc_dist.mat xyz = cell_of_double_pre_ballsCopy{1}; dxyz = diff(xyz); % difference between adjacent points in xyz coordin...

ongeveer een maand ago | 0

| accepted

Answered
Plot is not showing anything.
Replace your loop with h= 0.1; %step size for loop t = 0:h:1; for i = 1:numel(t) xt(i) = X0*exp((-S)*wn*...

ongeveer een maand ago | 0

Answered
How can I use a variable for formatting?
You can also use %*d, like this for k = 1:5 fprintf('%*d\n', k, 2*k); % the first argument (k) is the field width, 2*k is ...

ongeveer een maand ago | 1

| accepted

Answered
Is there a bug in imread() or imfinfo() with multiframe GIFs in R2021a/b?
Output of your test script theonlymap = 1.0000 0.0824 0.9137 0 0 0 0 0 0 0 0 ...

ongeveer een maand ago | 0

| accepted

Answered
How to Create/Modify for matrices or matrix
K=5; matA = 1:K matB = repmat(matA, 1, K)

ongeveer een maand ago | 1

Answered
3D Profile Extrude
x = [82, 80, 65, 38, 82]; y = [82, 54, 36, 94, 82]; x = repmat(x, 10, 1); y = repmat(y, 10, 1); z = (1:10)'; z = repmat(z, ...

ongeveer een maand ago | 0

| accepted

Answered
Damping and natural frequency
The damping ratio that you calculated is greater than one, meaning this system is overdamped (non-oscillatory). It has two real...

ongeveer 2 maanden ago | 1

| accepted

Answered
Matlab graph is not drawn
You aren't incrementing k or creating t in your loop. There are also other things wrong with your calculation of x. For one th...

ongeveer 2 maanden ago | 0

Answered
Try and Catch for multiple conditions
Maybe something like this: if isfield(src, 'DeviceName') Name = src.DeviceName; else Name = 'unknown'; % or, just do...

ongeveer 2 maanden ago | 0

Answered
Matlab is not recognizing the graph(...) function.
The graph function was added in release 2015b. See doc page here (the info on when it was introduced is at the bottom): https:/...

ongeveer 2 maanden ago | 0

| accepted

Answered
Filling an array with color points
j = 34; g = 3; A = zeros(j,g); A(:,3) = 1; % put ones in the third column A(:,2) = ([0:j-1]/j).'; % fill in the second colum...

ongeveer 2 maanden ago | 0

| accepted

Answered
How to change the type when creating HDF5 attributes.
I don't have any hd5 files to test this with, but I suspect that if you change this h5writeatt('tt.h5','/tide','Transient', "TR...

ongeveer 2 maanden ago | 0

Answered
Interpolating NaN values within a matrix
I would recommend the fillmissing function.

ongeveer 2 maanden ago | 0

| accepted

Answered
I try to run a for loop to plot the function y(t) for 0.1<=t<=0.9 for 5 diffrent t. Can you help me with my code?
You were pretty close. I had to change the loop to loop over the elements of t and save y one row at a time using y(i,:) using ...

ongeveer 2 maanden ago | 0

| accepted

Answered
I hope to show that aliasing occurs for more than one sinusoid
Perhaps you are looking for something like this? t = 0:1/500:0.02; x = 3*cos(2*pi*300*t+pi/3) + 8*cos(2*pi*800*t-pi/5); plot(...

ongeveer 2 maanden ago | 0

| accepted

Answered
How to append a string to a filename when saving a file?
This should get you closer to what you want to do [~,f,ext] = fileparts(files(id).name); % extract file name without original e...

ongeveer 2 maanden ago | 1

| accepted

Answered
How to use MATLAB RGB triplets and hexadecimal color codes for a custom plots?
I don't think you can specify name/value pairs in the plot command with multiple x/y values. This isn't very elegant but it d...

ongeveer 2 maanden ago | 1

| accepted

Load more