Answered
how do I extract top half of the data into a separate matrix and the bottom half into its own matrix?
A = 1.0e+03 *[ 0.2000 0.0002 2.6129 2.8161 0.2500 0.0002 2.7047 2.9356 0.3000 0.0002 2.7897 ...

6 years ago | 1

| accepted

Answered
showing roots of an equation
Write the coefficients of your polynomial as an array ans use roots. p = [1 -6 -12] ; s = roots(p) Use symbolic syms x ...

6 years ago | 0

| accepted

Answered
Matlab Help: Loading a Series of images into matlab
This question has been asked many times. tifFiles = dir("*.tif") ; N = length(tifFiles) ; for i = 1:N thisFile = tifF...

6 years ago | 0

Answered
variable-length time series
You can do inteprolation and get all the series to same dimensions/ length. Read about interp1. https://in.mathworks.com/help/...

6 years ago | 0

| accepted

Answered
How to plot that?
A=10; f=1000; n=5; T=1/f; t=[0:T/100:n*T]; s=A*exp(-t*1000).*sin(2*pi*f*t);

6 years ago | 0

Answered
Euclidean distance between two structs for nearest neighbour
dEuc = sqrt(V .* V'); Replace the above with dEuc = sqrt(sum(V.^2)); %% Demo A = rand(100,2) ; B = rand(100,2) ; dx = ...

6 years ago | 0

Answered
How to determine the distance between a group of XY pairs against other XY pairs within a matrix?
You can pcik the rows you want of 0 and 1 using logical indexing. Once you seperate two matrices, use pdist2. This will give y...

6 years ago | 0

| accepted

Answered
Plot Error Equation Error Needs Fix
Read about element by element operations. x = linspace(-0.02,0.02); y = -(2.56*10^10)*x; plot(x,y) title('\sigma_{xx}') ...

6 years ago | 0

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 1). Error can't seem to find the mistake
You have to specify the dimensions of row and column of a matrix. You should use Size. You have used length and it is creating p...

6 years ago | 0

| accepted

Answered
How to extract rows based on a particular column values in a matrix?
load D.mat ; A = D(D(:,2)>=1,:) ; B = D(D(:,2)<=-1,:) ;

6 years ago | 0

Answered
How I can to realize this function
n = 1:20 ; y = zeros(size(n)) ; y(n<=5) = n(n<=5).^2 ; stem(n,y)

6 years ago | 0

Answered
How to solve this multi degree of freedom equation using matlab code by applying newmark method.
Refer this: https://in.mathworks.com/matlabcentral/fileexchange/30465-newmark-time-integration-sheme?s_tid=srchtitle

6 years ago | 0

Answered
Given an array of co-ordinates, for each value of x, how do I extract the smallest value of y?
LEt (x,y) be your points. [c,ia,ib] = unique(x) ; n = length(c) ; iwant = zeros(n,2) ; for i = 1:n iwant(i,1) = c(...

6 years ago | 1

Answered
how to fill a matrix with different size vectors
Read about Cells. You can save them into cell. N = 10 ; iwant = cell(N,1) ; for i = 1:N iwant{i} = rand(randperm(10,1...

6 years ago | 0

| accepted

Answered
Why do I get "Array indices must be positive integers or logical values" error when trying to calculate the average range for the last five observation in line 121?
You should know that, the array indices in MATLAB should be positive integers or logicals. If not you will get this error. Dem...

6 years ago | 1

| accepted

Answered
How to retrieve data from one region out of 23 in a NetCDF file
You can load/ read the data from netCDf file using ncread. data = ncread("myncFile",'rainfall') ;

6 years ago | 0

Answered
How to write a code using if statement which when reads negative volume stops
for i = [1 2 3 4 0 5 -6 -7 ] if i < 0 break end i end

6 years ago | 0

Answered
How to plot time vs displacement?
Demo EXample: t0 = 1 ; t1 - 10; dt = 0.01 ; u = @(w,t) = cos(w*t) ; t = t0:dt:t1 ; w = 2*pi ; s = u(w,t) ; plot(t,s...

6 years ago | 0

| accepted

Answered
How to separate the dataset of 2300 data into 23 nos while reading an excel
iwant = reshape(data,23,100) ;

6 years ago | 0

Answered
Change X axis units
To convert seconds to hours multiply t by t_in_hours = t_in_seconds*1/(60*60) ; To convert uV to mV, multiply v by V_in_mV ...

6 years ago | 0

Answered
How do I plot this?
Read about plot. plot(T, Td1) hold on plot(T,Td2) xlable("T") ylabel("Td") legend("Td1","Td2")

6 years ago | 1

Answered
How to Group data points and add serial numbers within the group ?
A = [12 1 12 2 12 3 14 1 14 2 14 3 14 4 11 1 11 2] ; [c,ia,ib] = unique(A(:,1)) ; n = lengt...

6 years ago | 0

Answered
CAN ANYONE PLEASE PROVIDE AN EXPLANATION FOR THIS CODE ON AUDIO COMPRESSION? (the formula is for 60% compression i dont understand how it came)
[x,fs]=audioread('sample.wav'); % read the audio file N=length(x); % Get the length if the data vlcplayer=audioplayer(x,...

6 years ago | 1

Answered
How to read a file and assign important variables.
csv=csvread("IDV60901.95936.csv") ; % Read csv file. Have a look on readtable T= csv(20,:) ; % temperature RH = csv(27,:...

6 years ago | 0

| accepted

Answered
Clustering of row vector
A = rand(150,1) ; % random data for demo n = length(A) ; idx = randperm(n) ; % random the data B = reshape(A(i...

6 years ago | 1

| accepted

Answered
How do I plot this?
There is no z involved in your equation. This is your home work, so follow the below hints. Read about linspace. DEfine your x...

6 years ago | 0

| accepted

Answered
Calculate function with given t
Read about fplot/ ezplot. clc clear all close all syms t A = [-1, 1, 0; 1,-2, 1; 0, 1, -1]; [P,D] = eig(A) ...

6 years ago | 0

| accepted

Answered
Exclude point from my regression
Let I be your m*n image. [m,n] = size(I) ; [X,Y] = meshgrid(1:n,1:m) ; [r, c] = find(I>=224 & I<=225) ; % Get the pixel v...

6 years ago | 0

Answered
Generating a data sequence that results in this graph
x = -5:1:10 ; y = zeros(size(x)) ; y(x > -3 & x < 6) = 1 ; stem(x,y)

6 years ago | 1

Answered
undefined function or variable x
Save the below code in to a file say main.m. % solution of second-order differential equation % the function diff2(x,y) is cr...

6 years ago | 0

Load more