research interests: vibrations, optimal control, system modeling and simulation, mechatronics... coding

Solved

Draw a 'Z'.

Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

1 day ago

Solved

Draw a 'X'!

Given n as input Draw a 'X' in a n-by-n matrix. example: n=3 y=[1 0 1 0 1 0 1 0 1] n=4 y=[1 0 0...

1 day ago

Solved

Draw 'O' !

Given n as input, generate a n-by-n matrix 'O' using 0 and 1 . example: n=4 ans= [1 1 1 1 1 0 0 1 ...

1 day ago

Solved

Draw 'J'

Given n as input, generate a n-by-n matrix 'J' using 0 and 1 . Example: n=5 ans= [0 0 0 0 1 0 0 0 0 1 0 0 ...

1 day ago

Solved

Draw 'I'

Given n as input, draw a n-by-n matrix 'I' using 0 and 1. example: n=3 ans= [0 1 0 0 1 0 0 1 0] n=...

1 day ago

Solved

Draw 'H'

Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2) Example: x=5 ans= [1 0 0 0 1 1 0 0 0 1 ...

1 day ago

Solved

Draw 'F'

Draw a x-by-x matrix 'F' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

1 day ago

Solved

Draw 'E'

Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

1 day ago

Solved

Draw 'D'.

Draw a x-by-x matrix 'D' using 0 and 1. example: x=4 ans= [1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0]

1 day ago

Solved

Draw 'B'

Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 0 1 0 0 0 1 ...

1 day ago

Answered

How can the arrow remain on the graph whilst the the other plots are produced?

close all % already takes care of your issue To avoid overlapping of the animated plot with legend, you may need to consider th...

How can the arrow remain on the graph whilst the the other plots are produced?

close all % already takes care of your issue To avoid overlapping of the animated plot with legend, you may need to consider th...

1 day ago | 0

Answered

Surf Plot error code with Z having to be defined as a matrix, not scalar or vector

There are a couple of errs. Here is the corrected code x=-1:1:1; y=-1:1:1; [X,Y]=meshgrid(x,y); % Ver 1. Z=(x(:)-y)./(1+y);...

Surf Plot error code with Z having to be defined as a matrix, not scalar or vector

There are a couple of errs. Here is the corrected code x=-1:1:1; y=-1:1:1; [X,Y]=meshgrid(x,y); % Ver 1. Z=(x(:)-y)./(1+y);...

1 day ago | 0

| accepted

Answered

Index exceeds the number of array elements in for loop

Easy solution is to get all file names to be read (to be imported in *.txt). That can be done with: Finfo = dir('*.txt'); Fnam...

Index exceeds the number of array elements in for loop

Easy solution is to get all file names to be read (to be imported in *.txt). That can be done with: Finfo = dir('*.txt'); Fnam...

1 day ago | 0

Answered

Y-Label upside down on on videoreader

The cause can be explained with data import and record them into MATLAB workspace. You may consider using flip() to correct the...

Y-Label upside down on on videoreader

The cause can be explained with data import and record them into MATLAB workspace. You may consider using flip() to correct the...

1 day ago | 0

Answered

Index exceeds the number of array elements in for loop

The problem is with this 3rd party fcn file: filesSorted = natsortfiles(file_list); Note that the variable file_list contains...

Index exceeds the number of array elements in for loop

The problem is with this 3rd party fcn file: filesSorted = natsortfiles(file_list); Note that the variable file_list contains...

1 day ago | 0

Answered

How to use maximum likelihood estimation (mle) if the custom function has an integration inside?

There are a few potential errs in your code: (1) Typo: the variable in PDF expression beat has to be beta > Still some work is...

How to use maximum likelihood estimation (mle) if the custom function has an integration inside?

There are a few potential errs in your code: (1) Typo: the variable in PDF expression beat has to be beta > Still some work is...

1 day ago | 0

Answered

Extracting data from .mat file (EMG Signal)

Use cell2mat(kF) % Gives all data in kF in a matrix array Or if you are only interested in specific, e.g. cell2mat(kF{1,1}...

Extracting data from .mat file (EMG Signal)

Use cell2mat(kF) % Gives all data in kF in a matrix array Or if you are only interested in specific, e.g. cell2mat(kF{1,1}...

1 day ago | 0

Answered

How to plot vectors

A = ... % Your data H = histogram(A); H.FaceColor = 'y'; % Face Color H.EdgeColor = 'r'; % Edge Color

How to plot vectors

A = ... % Your data H = histogram(A); H.FaceColor = 'y'; % Face Color H.EdgeColor = 'r'; % Edge Color

1 day ago | 0

Solved

Right Triangle Side Lengths (Inspired by Project Euler Problem 39)

If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

1 day ago

Solved

Target sorting

Sort the given list of numbers |a| according to how far away each element is from the target value |t|. The result should return...

1 day ago

Solved

Calculate the Levenshtein distance between two strings

This problem description is lifted from <http://en.wikipedia.org/wiki/Levenshtein_distance>. The Levenshtein distance betwee...

1 day ago

Solved

middleAsColumn: Return all but first and last element as a column vector

Given input A, return all but the first and last elements, arranged as a column vector. (I.e., all dimensions after the first s...

1 day ago

Solved

Find the two most distant points

Given a collection of points, return the indices of the rows that contain the two points most distant from one another. The inpu...

1 day ago

Solved

04 - Scalar Equations 2

Define the variables a and b: <<http://samle.dk/STTBDP/Assignment1_4-a.png>> <<http://samle.dk/STTBDP/Assignment1_4-b.png>...

2 days ago

Solved

"mirror" matrix

Create n x 2n "mirror" matrix of this type: Examples For n = 2 m = [ 1 2 2 1 1 2 2 1 ] For n = 3 m = ...

2 days ago

Solved

Create a vector whose elements depend on the previous element

The idea is to create a vector A whose elements depend on the previous element : *A(i+1) = 2*A(i)+1* *2 Inputs*: - A : The...

2 days ago

Solved

Draw 'C'.

Given x as input, generate a x-by-x matrix 'C' using 0 and 1. example: x=4 ans= [0 1 1 1 1 0 0 0 ...

2 days ago

Solved

Draw a 'N'!

Given n as input, generate a n-by-n matrix 'N' using 0 and 1 . Example: n=5 ans= [1 0 0 0 1 1 1 0 0 1 1 0 ...

2 days ago

Solved

Make a 1 hot vector

Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

2 days ago

Solved

Is the input divisible by 3?

Return true if the input is divisible by 3 and false if not.

2 days ago