Answered
How to insert value in a specific row and column of cell array ?
A = [100 50 600 500 35 20 300 100 200 500 600] ; idx = A==100|A==200|A==500

7 years ago | 0

Answered
create vector based on string data
S = { 'FA.EA'; 'FA.EB'; 'FA.EC'; 'FA.EA'; 'FA.EB'; 'FB.EC'; 'FB.EA'; 'FB.EB'; 'FC.EC'; 'FC.ED'; 'FC.EA'; 'FC.EB'} v...

7 years ago | 1

| accepted

Answered
Non zero min 3D matrix
A = rand(10,10,10) ; for t =1:10 for k = 1:10 D = A(k,:,t) ; D = D(D>0) ; f(k,1,t) = max(D); ...

7 years ago | 0

| accepted

Answered
Problem with Index (Dufort Frankel Scheme)
I strongly advice you to check and rethink on your code. xl=0; xr=1; % x domain [xl,xr] J = 10; ...

7 years ago | 0

| accepted

Answered
How to fit same variance of data to another data ?
Probablu you need to interpolate the data.....read about interp1

7 years ago | 0

Answered
Fetching x axis Data values and corresponding y data value
To get the y values correspeonding to x: idx = x >4 & x<5.1 ; x1 = x(idx) ; y1 = x(index) ; % To get others x2 = x(~i...

7 years ago | 1

| accepted

Answered
Connecting point in Matlab
imshow (I) hold on uiwait(msgbox('Idenitfy three points on the leaflets that indicate the begining of a leaflet, a point wher...

7 years ago | 0

| accepted

Answered
how to make subplots with fig files?
https://in.mathworks.com/matlabcentral/answers/101806-how-can-i-insert-my-matlab-figure-fig-files-into-multiple-subplots

7 years ago | 0

Answered
If the value is equal to a element in the matrix.
A = [ 1 29000 ; 2 30000 ; 3 4200 ]; B = [ 1 1 2 ...

7 years ago | 0

| accepted

Answered
Extract all columns for a single row in a cell array
A {1,1} = [1 0 0 0] ; B {1,1} = [12 34 54 11 31 51 26 44 94 15 54 58 ]; B{1,1}(logical(A{...

7 years ago | 1

| accepted

Answered
How to reverse an animation
Reverse M before writitng into video... M = fliplr(M) ; writeVideo(v,M); close(v); movie(M,1)

7 years ago | 1

Answered
Values of vectors in matrix (changes in time)
t =0:pi/20:4*pi; x1 = cos(t); x2 = cos(2*t); x3 = cos(3*t); x4 = cos(4*t); A = zeros(2,2,length(t)) ; for i = 1:length(t...

7 years ago | 0

Answered
Generate 2D surface map using 3 parameters
Read about pcolor, scatter

7 years ago | 0

| accepted

Answered
How to get the corresponding value
Read about max ..it gives you index of maximum value also. Let A be your m*3 array. [val,idx] = max(A(:,2)) ; % say you ...

7 years ago | 0

Answered
Replace a block of strings in a text file with another string
YOu should follow something like below: fid = fopen('data.txt') ; S = textscan(fid,'%s','delimiter','\n') ; S = S{1} ; fc...

7 years ago | 0

Answered
How can I make a repeating rectangular wave with a specified period?
n = -20:20; y = rectangularPulse(-3.5,3.5,n); y1 = repmat(y,1,4) ; n1 = 1:length(y1) ; stem(n1,y1);

7 years ago | 0

Answered
how do you change the colour of the error bars using the dock figure tool?
x = 1:10:100; y = [20 30 45 40 60 65 80 75 95 90]; err = 8*ones(size(y)); errorbar(x,y,err,'r') YOu can specify color in the...

7 years ago | 0

Answered
Plotting/Graphing Vertical Force Data compared to sacral marker height data
cd('C:\Excel Spreadsheets') %Column of Data a = xlsread('Assign 7_Increased_01.xlsx','H6:H3225'); b = xlsread('Assign 7_Incre...

7 years ago | 0

Answered
How to loop multiple text files with different filenames ?
files = dir('*.txt') ; N = length(files) ; for i = 1:N thisfile = files(i).txt ; % Do what you want end

7 years ago | 0

Answered
Does 'ncread' automatically takes the 'add-offset' and 'scale factor' into account before returning the results?
When you read a variable from netCDF using ncread, it will read the whole variable as it is written/ present in the file. It wil...

7 years ago | 0

Answered
How can I find the centroid of an object in an image and crop a portion of it around that centre point
I = imread('image.jpeg') ; [nx,ny,nt] = size(I) ; x = 1:ny ; y = 1:nx ; C = round([mean(x) mean(y)]) ; idx = C(2)-227:C(2)...

7 years ago | 0

| accepted

Answered
Can't find the maximum on the graph of a function
t = 0:30; h = (-(9.8/2).*t.^2)+(125.*t)+500 ; [val,idx] = max(h) ; h_max = val ; t_max = t(idx) ; plot(t,h) hold on...

7 years ago | 0

| accepted

Answered
How do I write a function that receives a matrix as an input and returns the sum of only the positive number of each row?
Save below function. It will be saved on the name sumrow. function sumRowPos = sumrow(r) w = r; w(r<0) = 0; sumRowPos = su...

7 years ago | 1

Answered
Extract data using textscan
Read about csvread, readtable and xlsread. [num,txt,raw] = xlsread('CRSP test.csv') ;

7 years ago | 0

| accepted

Answered
plot a curve throughout max and min values
Read about envelope https://in.mathworks.com/help/signal/ref/envelope.html

7 years ago | 0

Answered
How to close the extra legend added by comet fun?
x = 1:100 ; y = rand(size(x)) ; figure h = plot(x,y) ; hold on comet(rand(size(x))) ; legend(h,'one')

7 years ago | 0

| accepted

Answered
how to integrate a scatter3 and for loop graph in such a way that all the figures are shown in the same graph
YOu shoul duse hold on to get the next coming data to get plotted on the exsitng plot. Read about hold on.

7 years ago | 0

Answered
Reading in text file using textscan.
Read about readtable. T = readtable(myfile) ;

7 years ago | 0

Answered
Tracking a point in a graph
YOu can use the concept maxima and minima....you may refer here: https://in.mathworks.com/matlabcentral/answers/37103-finding-tu...

7 years ago | 0

| accepted

Answered
How to handle large numbers in Matlab?
Check here: https://in.mathworks.com/matlabcentral/answers/352501-calculating-the-greatest-common-divisor-for-two-positive-inte...

7 years ago | 0

Load more