Answered
how can i give values in the range[10 300] to v inside the for loop(loop for time 1:4000)?
Divya, no need for loops: t = 1:4000; v = 10:10:300; A = 1; f = 1; inc = 1; dx = 1; X = v'*t + A*ones(numel(v),1)*...

12 years ago | 1

| accepted

Answered
sir,i want to convert string into a hexadecimal value...is there any direct command?
Satya, hex values are interpreted as strings, so no need for a transformation. E.g. a = hex2dec('abc') % converting hex nu...

12 years ago | 0

Answered
how to append "specific columns" in an array
Pooja, use B = reshape(repmat(A,3,1),length(A(:,1)),[]) assuming the first column is (supposed to be, typo?) equal to the...

12 years ago | 1

| accepted

Answered
Projectile Motion, decreasing value of y below zero
Carl, from a physicist's perspective I'd guess that the most elegant solution would be to compute the time of flight to set the ...

12 years ago | 1

Answered
How to stop extraneous lines when using 'mesh'?
Does this help? x = -1:0.1:1; y = -1:0.1:1; [X,Y] = meshgrid(x,y); Z = power(Y,2) - power(X,2) - 0.5; mesh(X,Y,Z) ...

12 years ago | 0

Answered
How to plot the probability density function using vectorisation.
Guiseppe, something like mu = 0; si = [1 2 3 4 5]; x = linspace(-10,10,200); [X,SI] = meshgrid(x,si); f = 1./sqrt(...

12 years ago | 1

| accepted

Answered
parametric plot with values of parameter on plot
Mohsen, would this do (using ticks and tick labels)? t = -pi:.1:pi; y = sin(t); plot(t,y) set(gca,'XTick',-pi:pi/2:pi)...

12 years ago | 0

Answered
frequency of element in matrix
Sumi, use [bincounts] = histc(reshape(a,1,N*N),min(min(a)):max(max(a)))

12 years ago | 0

Answered
Plotting f(x) as a function of x logistic map
Sumon, see the code below: r = 2.0; x(1) = 0.3; N = 40; for ii = 1:N x(ii+1) = r*x(ii)*(1 - x(ii)); end ...

12 years ago | 1

| accepted

Answered
multidimensional array to column vector with different dimensional order?
Sriram, use reshape(permute(B,[3 2 1]),1,27)

12 years ago | 0

| accepted

Answered
What is the MATLAB & Simulink Racing Lounge?
Hello Formula Student teams, MathWorks would like to invite you to participate in the *MATLAB & Simulink Racing Lounge* . T...

12 years ago | 0

| accepted

Answered
When I am doing Newton's Method with a tolerance, how do I only get the values up until it reaches the tolerance?
Christopher, I am not quite sure I understand your code. * What's the reason for executing |myNewton| twice, once for |R| onc...

12 years ago | 0

Answered
Does the new Matlab Home license include Software Maintenance Service?
Jacob, MATLAB Home *does not* include Software Maintenance Service.

12 years ago | 1

| accepted

Answered
Check values using if condition for each element of two rows in a matrix
Damith, this is the basic structure: data = rand(8,40); for ii = 1:length(data(:,1))-1 % loop through a...

12 years ago | 0

Answered
(x̄ - μ) in MATLAB
Ashley, |zscore(A)| can also be computed as n = size(A,1); zScoreA = (A - ones(n,1)*mean(A))./(ones(n,1)*std(A));

12 years ago | 0

| accepted

Answered
how to convert a fichier.m to simulink blocks.?
Lahssan, you can simply use a MATLAB Function block (in: Simulink library > User-Defined Functions), open the block and paste th...

12 years ago | 0

Answered
Could you help me solving the question regarding to coordinates, please?
Rengin, use data = [2,4; 2,10; 2,15; 5,14; 6,7; 6,15; 8,16; ...

12 years ago | 0

| accepted

Answered
Plot the electric field distribution ?
Use |hold all| before or after the first plot command: quiver(...) % replace the dots with your data hold all; contour...

12 years ago | 1

| accepted

Answered
error + matrix dimension must agree
Nik, |X| and |T| need to be same-sized vectors unless |T| is a scalar. What are you trying to do in a = sign(X(ind1)).*(...

12 years ago | 0

| accepted

Answered
How to do solve Riccati differential(matrix) equation backward
|X0| are the initial conditions of the differential equations. The |[]| are a placeholder for the integrator <http://www.mathwo...

12 years ago | 0

Answered
Monthly average from daily data
Filipa, use something like data = [data; zeros(1,30*round(numel(data)/30)-numel(data))] avdata = mean(reshape(data,nume...

12 years ago | 0

Answered
How can I replace NaN with '#N/A' in a dataset and write it to Excel?
Bond, you could use a = rand(3,2); a(2,2) = NaN; b = num2cell(a); b(isnan(a)) = {'#N/A'}; bheader ...

12 years ago | 0

| accepted

Answered
Plotting approximation error in Newton-Raphson
Hidir, I assume you are using a |while|-loop that you execute until the relative error is smaller than some given tolerance. Som...

12 years ago | 1

| accepted

Answered
Merge two cells into a single cell?
TUD, use w = str2num(num2str([x' y'], '%-d'))'

12 years ago | 0

Answered
Code for elements in equation to create a matrix
Lo, no need to use loops: A = 1./(f*D) Make sure that |D| is a column vector.

12 years ago | 0

| accepted

Answered
Why matlab giving me same values too many times
Sumon, I think you are referring to fact that the series approaches |x = 0.5| for increasing |i|. This is absolutely to be expec...

12 years ago | 0

| accepted

Answered
Calculating BPM - from PPG signal
Check out the <http://www.mathworks.com/help/signal/ref/findpeaks.html |findpeaks|> command. Alternatively (if you do not have a...

12 years ago | 1

| accepted

Answered
where to find SimEvents library in Matlab student version
Ammar, SimEvents is not included in the standard MATLAB Student version. It can be included as an <http://www.mathworks.com/acad...

12 years ago | 0

Answered
How to label a class in an array in matlab
Syd, you could use a <http://www.mathworks.com/help/matlab/matlab_prog/create-a-structure-array.html structure array>: BigMa...

12 years ago | 0

Answered
How to append data inbetween the Array without overwriting its original data ?
Pooja, check out <http://blogs.mathworks.com/pick/2008/05/16/inserting-rows/ INSERTROWS> (description in Jiro's blog) in the Fil...

12 years ago | 0

Load more