Answered
How to find Y value that corresponds to the maximum X value in these graphs?
files = dir('*.txt') ; N = length(files) ; iwant = zeros(N,2) ; for i = 1:N data = load(files(i).name) ; [val,idx] ...

8 years ago | 0

Answered
Programme is not giving any output
I suspect, you are using == on flottants...try the below code. tol = 10^-6 ; for i=1:size(X,1) t1=abs(centroids(1,1)-X(i,1...

8 years ago | 0

Answered
Filter a table by 2 columns
idx = strcmp(T.Gender,'Male') ;

8 years ago | 0

Answered
Error with dot product? Dot product of cross product vectors is not 0
How about trying the same with unit vectors? %gps reported positions (xSec_DDMMYYYY) x0_18081997 = [3325396.441 5472597.483...

8 years ago | 0

Answered
How can I solve my ODE xdot=AX+Bu
% Quarter Car Model Simulation: clear all t=0; %Initial time dt=0.01; %Step size t...

8 years ago | 0

Answered
How to save the value of the loop number it is at when x cross +/- 25 in an array
x1 and x2 gives you the iteration for each trial. Position = 0; Step=[]; cross25 = []; trials = input('Enter the number o...

8 years ago | 0

Answered
How do I combine multiple excel chart into one using matlab?
Load the excel data using readtable....join them by using join. Refer: https://in.mathworks.com/matlabcentral/answers/3773...

8 years ago | 0

Answered
Kindly help to solve the following error
It seems you are running the function straight away using Run button..you are not providing any inputs......provide the inputs a...

8 years ago | 0

Answered
Using a pair of nested for loops to find a max of a function across a range of variables
Learning MATLAB is very easy.....it will take few minutes to undertand the syntax.....Below I am givng you a code to get the max...

8 years ago | 0

Answered
vertical line through all the subplots
x = 1:10 ; y = rand(1,10) ; figure hold on plot(x,y) x1 = 5*ones(1,10) ; y1 = linspace(min(y),max(y),10); plot(x1,...

8 years ago | 0

| accepted

Answered
How can the shear force diagram be plotted?
N = 10 ; X = 1:N ; % beam Y = zeros(1,N) ; defo = rand(1,N) ; idx = randsample(N,4) ; defo(idx) = -defo(idx) ; figure ...

8 years ago | 0

Answered
Merging of two csv files
Read about readtable and join

8 years ago | 1

Answered
Detect all the rectangles in image
I = imread('myImage.jpeg') ; [y,x] = find(I>50) ; imshow(I) hold on idx = kmeans([x y],4) ; for i = 1:4 plot(x...

8 years ago | 1

Answered
could anyone help me how to change the number of clusters for every iteration
A=[1 2; 3 4; 5 6; 7 8; 9 10; 11 12] ; G = size(A,1) ; idx = cell(G,1) ; for i = 1:G idx{i} = kmeans(A,i) ; end

8 years ago | 0

| accepted

Answered
Saving multiple figures of loop in one subplot
for i = 1:3 subplot(3,1,i) plot(rand(10,1)) title(num2str(i)) end

8 years ago | 0

| accepted

Answered
How obtain the Y value that corresponds to the largest X value for a number of plots?
Read about the function max Let X,Y be your data. [max_x,idx] = max(X) ; max_y = Y(idx) ;

8 years ago | 0

Answered
What is wrong with this code?
'a/rw^2'== The above is completely wrong........variable shoould be simply: a = your expression There are lot of typos...y...

8 years ago | 1

Answered
Find centre point of coordinates in three dimensional space and then calculate euler angles relative to the centre point.
Let A be your 2000X3 data points. YOu can get your center using mean C = mean(A) ; To get angle refer: https://in.mathworks...

8 years ago | 0

Answered
Problem in running my code
TN=4; n_vec=1:TN; n=n_vec; themax=[0.32 0.51 0.112 1.3]; B=0.3; Psi=0.6; No=0.01; tau=B./n; for Max=themax; h=ran...

8 years ago | 0

Answered
Finding the minor and cofactor for a matrix using matlab
Refer this: https://in.mathworks.com/matlabcentral/fileexchange/2284-introductory-linear-algebra-with-applications

8 years ago | 0

Answered
Get number of occurrences of value in a specific position in matrix
As you know the locations.....you have indices in hand.....pick those values......check with your value: iwant = nnz(matrixva...

8 years ago | 0

Answered
Get a set of arrays as input from user in matlab function
Read about input prompt = 'Enter Array:'; x = input(prompt) ;

8 years ago | 0

Answered
ode45 problem with plotting
You should change view to 1. And there is small change in the name of variable..hope the below one works: function [t,th,r...

8 years ago | 0

| accepted

Answered
segment of large data .mat file of 2 hr in 5 minute .mat files
S = load('01911m.mat') ; val = S.val ; n = length(val) ; t = linspace(1,2*60,n) ; % get for every five mins ti = 1:round(n...

8 years ago | 0

| accepted

Answered
how to merge two images of different file types?
It can be done: Read the image 1 say I1 Read the image 2 say I2 Get both I1, I2 to same size using imresize, if they are o...

8 years ago | 0

| accepted

Answered
How do I save the contents of a structure as a textfile?
S = struct() ; S.time = (1:100)' ; S.values = rand(100,1) ; S.type = 'Wave form' ; S.unit = 'mv' ; S.samplerate = 300 ; ...

8 years ago | 0

Answered
Command to get specific row and column data to be displayed in the code
% Make dummy data A = [rand(10,1) rand(10,1)] ; s = ones(10,1) ; s(1:5) = -1; A(:,2) = s.*A(:,2) ; % get index of sign c...

8 years ago | 0

Answered
How to dynamically allocate labels to a legend?
n=5 ; lgd = cell(n,1) ; figure hold on for i=1:n plot(rand(10,1)) ; lgd{i} = strcat('X=',num2str(i)) ; end leg...

8 years ago | 9

| accepted

Answered
Columb's law in Matlab
Actually this is an home work problem....we dont solve your home work problems.......As you have asked to give some insight and ...

8 years ago | 0

Answered
Plotting Multiple Histograms with Increasing Number of Bins
count = 0 ; for i = 1:3 for j = 1:3 count = count+1 ; subplot(3,3,count) plot(rand(3,1)) ...

8 years ago | 1

Load more