Answered
Index in position 2 exceeds array bounds?
m = length(jaywalk) ; n = length(plate) ; if m ~= n error("length of jaywalk and plate should be same") else for i=1:n...

6 years ago | 0

Answered
Error using plot Vectors must be the same length
for i=1:n sumx=sumx+x(i); sumy=sumy+y(i); sumxy=sumxy+x(i)*y(i); sumxx=sumxx+x(i)*x(i); end Toa chieve above ...

6 years ago | 0

| accepted

Answered
syms dependent on time with dots
syms A theta(t) phi(t) ; u = A*cos(theta)+phi du = diff(u,t)

6 years ago | 0

Answered
ODE Evaluating and Error using vertcat. Dimensions of arrays being concatenated are not consistent.
The problem is with the function G. Are you expecting a 1*5 matrix from G? If so it is not giving you 1*5. The first two eleemnt...

6 years ago | 0

Answered
matrix store issue for loop iteration
r = cell(1,3) ; for i = 1:3 r{i} = [s m] end If You feel r will have same size m*p in every iteration, you can initilai...

6 years ago | 0

Answered
how to check for a perfect square in a Matrix
A = [ 2,4,7 ; 8,7,3 ]; b = (mod(sqrt(A), 1) == 0) A(b)

6 years ago | 2

Answered
How to calculate the diameter of 3D Gaussian normal distribution?
Let X, Y,Z be your matrices. val = 0.5 ; % at this z-value I want radius / diameter idx = abs(Z-val) < 10^-3 ; x = X(idx...

6 years ago | 0

| accepted

Answered
Mean between an interval
idx = round(90000-P*0.2*1732:90000) ; Average=mean(M3(idx)); Your indices are not integers.....you got some fractions also......

6 years ago | 0

| accepted

Answered
Unable to perform assignment because the left and right sides have a different number of elements.
s_code = cell(100,1); for i=1:100 s_code1{i}=strcat({s_code{2*i-1},s_code{2*i}); end

6 years ago | 0

| accepted

Answered
How can I solve the equations as shown? I cannot get the desired answers using the given code.
You have to convert syms class to double. Read about double, vpa. Try: t3 = double(theta3) ; T3 = vpa(theta3) ;

6 years ago | 0

Answered
How to use the solve function to find roots of the equation f(x)=sin[sin(x)]+e^x=0
symbolic solution was throwing error for me. (in Octave). This is a brute-force method. There might be elegant solution possible...

6 years ago | 0

Answered
Please help me write the f function in matlab
Read about sin, cos Read about exp. Read about linspace. Example: If I want to write a function for sin(pi*x) m = 100 ; ...

6 years ago | 0

Answered
How do I get this to plot correctly?
%% % Constant Acceleration Calculator % Constant Velocity is = Initial Velocity + Constant Acceleration * Time %Vi = init...

6 years ago | 0

Answered
How to display exactly 2^64?
val = 2^64 ; fprintf("%f\n",val)

6 years ago | 0

Answered
cut some images into same size and i can set (x1,y1), (x2,y2) diagonal
Rect = [x1 y1 x2-x1 y2-y1] ; I1 = imcrop(I,Rect) ; Rect should have initial indices and length, breadth. Also you can use:...

6 years ago | 0

Answered
Sum a value in a matrix
A = zeros(4,3) ; A(2,:) = 3 ;

6 years ago | 0

| accepted

Answered
How to solve difference equation in MATLAB
n = 50 ; y = zeros(1,n) ; y(1:2) = 1 ; for i = 2:n-1 y(i+1) =5/2*y(i) +y(i-1) ; end

6 years ago | 1

Answered
how to correctly get values for stress for Y >82 values should be close to zero at Y = 88.25
You have to use logical indexing to achieve this. clc; clear all ; p = -100; y = 0:0.25:88.25; l = 1:1:199; ybar = 63.17; ...

6 years ago | 0

Answered
Averaging Every Element of some matrices
Read about mean. You can specify your required dimension to get the mean along. A = rand(12,1,40) ; M = mean(A,3) ;

6 years ago | 0

Answered
Plotting a graph for each group/category in a table
Read about gscatter.

6 years ago | 1

| accepted

Answered
How do I write a range of values from minimum to maximum in black and white image display
I = imread(image) ; % give your image name imshow(I) ; I0 = min(I(:)) ; % min value I1 = max(I(:)) ; % max value

6 years ago | 0

| accepted

Answered
Reduce a vector to the size of another vector
Read about ismember, ismembertol, knsnearch. If v is the vector and val is the value for which you want to get the closest val...

6 years ago | 0

| accepted

Answered
Saving data from for loops
clear all close all clc Mmax=10.76; %Maximum mass Mmin=10.32; %Minimum mass Mdiff=0.44; %Mass difference UptakeW=(Mdiff/...

6 years ago | 0

| accepted

Answered
How to generate a mesh of two connected / overlapping circles?
Read about Transfinite Interpolation (TFI). https://in.mathworks.com/matlabcentral/fileexchange/40618-grid-generation https:...

6 years ago | 0

Answered
How to find out whether a number is prime or not using for loop?
You gogole it..you will get many links.This question ahs been asked multiple times. https://in.mathworks.com/matlabcentral/ans...

6 years ago | 0

Answered
Select a certain number of mine Vector Members in MATLAB
Let v be your vector. You can arrange them from small to big order i.e in ascending order and then pick first twenty elements. ...

6 years ago | 2

| accepted

Answered
how can i covert rgb image to HSI and separate the intensity component alone
https://in.mathworks.com/matlabcentral/fileexchange/13630-rgb-to-hsi-conversion Read about rgb2hsv

6 years ago | 0

Answered
Matlab matrices and vectors
Read about MATLAB indexing.......if A is given array. A(1:3) % gives first three elements A(end) % gives last element ...

6 years ago | 2

Answered
Matlab matrixes and codes
Read the basic documentation instead of asking simple questions. iwant = ones(20) ;

6 years ago | 0

| accepted

Answered
Writing a for loop to perform an operation on a vector
Vectorized x = [4,2,6,5,3,8,2] ; n = 1:7 ; %[n1 n2 n3 n4 n5 n6 n7] ; iwant = sum((1+x(1:6)).^n(1:6)) ; Loop: x = [4,2,...

6 years ago | 0

Load more