Answered
how to create num2str in a variable
str = ['X',num2str(1),'_f',num2str(2),'_Y',num2str(1),' = Z1',num2str(1),'p']

6 years ago | 0

Answered
How to give value of string to another string
Gender=input('Please input your gender: ','s'); Age=input('Please input your age: '); RHR=input('Please enter your resting hea...

6 years ago | 0

Answered
How transform matrix to vector
A = [1 2 3 ; 8 9 7] ; iwant = A(:)

6 years ago | 0

| accepted

Answered
How can I solve this derivative problem in the matlab program?
syms x f = (x^2+1)*(x^3+3) ; df = diff(x) simplify(df)

6 years ago | 0

| accepted

Answered
How to plot velocity component
Read about quiver. https://www.mathworks.com/help/matlab/ref/quiver.html

6 years ago | 0

| accepted

Answered
How to measure surface area layer by layer using Matlab
data = importdata("Cone_20000_points.txt") ; data = round(data) ; x = data(:,1) ; y = data(:,2) ; z = data(:,3) ; zi = uni...

6 years ago | 1

| accepted

Answered
Jacobi Plane rotation for a matrix A
Define the ngle of your rotation theta: A = [-17.7147 -38.4117 30.6475 -51.3024 17.3859 -10.0354 -19.3323 -38.89...

6 years ago | 0

Answered
Error using plot: Vectors must be the same length.
%% 2.0 Generate the noise waveforms additive_noise_first = repmat(Signal3, 1, period); % assumoing this to be column/ array ...

6 years ago | 0

Answered
I want to plot a line but got a curve
t = (0:0.01:0.64)' ; a = -9.81*ones(size(t)) ; plot(t,a)

6 years ago | 0

| accepted

Answered
Im not able to find the error
Xlsread has become obselete. You should try readtable. T = readtable(myfile) ; From T you can pick any column, index you want...

6 years ago | 0

Answered
How to plot values on a curved line or display values along a curved line?
You can display the values at a given locations (x,y) using the function text. Read about it. https://www.mathworks.com/help/m...

6 years ago | 0

Answered
Extracting points representing curve
In case are you looking for polyfit. ? Let (x,y) be the points you have and you want fit a quadratic polynomial. p = polyfit(x...

6 years ago | 0

Answered
How to replace values in matrix B with a constant at indices of matrix A for which the values in A meet a condition?
Read about sun2ind. [r,c] = find(A >= 108); idx = sub2ind(r,c,size(A)) ; B(idx) = 555 ;

6 years ago | 0

Answered
Error using plot Invalid data argument.
% Plot the x and y arrays. plot(x, y, 'k-', 'LineWidth', 1, ... xexp, Trial1, 'go', ... xexp, Trial2, 'rx', ... ...

6 years ago | 0

Answered
How to sum every elements that have the same frequency?
A = [0.2 0.4 0.8 0.6 1.2 0.3]; B = [ 2 2 1 2 1 1]; iwant = [sum(A(B==2)), sum(A(B==1))]

6 years ago | 0

| accepted

Answered
How to save a vector in a for loop
% To save a scalar in a loop to vector n = 10 ; A = zeros(n,1) ; for i = 1:n A(i) = rand ; end % To save a vector ...

6 years ago | 0

Answered
Someone please help me, I have probability mass function as follwing, How can generate 100 random values of j from this probability mass function?
DEfine alpha and lambda values. DEfine j value. WRite your formula and substitute those values.

6 years ago | 1

Answered
plotting a graph with different size markers
Read about scatter.

6 years ago | 0

| accepted

Answered
Permutation of rows with specfic conditions
A =[ 6 4 6 9 6 4 6 9 6 4 6 4 4 0 4 5 9 1 6 4...

6 years ago | 0

Answered
How do I extract, sort and plot data from multiple individual .txt files?
To read all the text files: txtFiles = dir("*.txt") ; N = length(txtFiles) ; for i = 1:N thisFile = txtFiles(i).name ;...

6 years ago | 0

Answered
Colour plot using single x, y and multiple z values
num = xlsread("data.xlsx") ; x = num(:,1) ; y = num(:,2) ; Z = num(:,3:end) ; pcolor(x,y,Z) ; shading interp ; color...

6 years ago | 1

Answered
need to take the, current_point, that I am at and calculate the distances of the, points_to_check, in order to determine the, closest_point.
Read about knnsearch. https://www.mathworks.com/help/stats/knnsearch.html This is your function, go for it.

6 years ago | 0

| accepted

Answered
How do I average values within a matrix and save this average as their new values?
A = [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16] ; % Get the sizes...

6 years ago | 0

Answered
Find function for Matrix
When you are comapring a floating point number you should not use ==, you should fix some tolerance and use inqualitty. Check th...

6 years ago | 1

| accepted

Answered
Derivative of arctangent function shown below
syms phi psi theta c s eqn = phi-atan(s*psi*c*theta/(c*psi+c*theta)) ; d1 = diff(eqn,psi) % derivative wrt psi d2 = d...

6 years ago | 1

| accepted

Answered
Error: In an assignment A(:) = B, the number of elements in A and B must be the same.
T = 5; %period sample = 44100*20; % samples period = 4; %required number of periods SinglePeriod = linspace (0, T, 44100*5 + ...

6 years ago | 0

| accepted

Answered
Index exceeds the number of array elements (16)
Desde(j):Hasta(j) In the above Desde = [1 2 6] ; Hasta = [0 4 23] ; For j = 3 Desde(j):Hasta(j) = 6:23 = 6 7 8 ...

6 years ago | 0

| accepted

Answered
Converting a 1x1 cell array to a vector
Read about cell2mat.

6 years ago | 1

| accepted

Answered
Insertion of header in the first row of .txt file
Something like this should work. filename = 'test2.txt'; fid = fopen(filename,'w'); fprintf(fid, 'HEADER \n'); fclose(fid);...

6 years ago | 0

| accepted

Answered
ENLARGE AND CHANGE COLOR OF A FRACTION IN TITLE !
plot((1:10).^2) title(['\fontsize{16}black {\color{magenta}magenta '... '\color[rgb]{0 .5 .5}teal \color{red}red} black again'...

6 years ago | 0

Load more