Answered
Converts a string into a function to plot
equ=sin(x); f= @(x) equ; x = linspace(0,2*pi) ; plot(x,f(x))

6 years ago | 0

Answered
How to Write cell array to Excel
Read about xlswrite and writetable.

6 years ago | 0

Answered
Adding elements between 2 values
iwant = linspace(1,2,99) Also n = 99 ; dx = (2-1)/(n-1) ; x = 1:dx:2 ;

6 years ago | 1

| accepted

Answered
how can i find specific value on step response plot?
n=[1]; d=[1 3 5]; sys=tf(n,d); [y,t] = step(sys) ; plot(t,y) Now you have the data, you can use interp1 to get the value. ...

6 years ago | 1

| accepted

Answered
How do I find major and minor axis of each human cells?
As you have data in hand, you can try fitting a ellipse to the data and get major, minor axes. There are variety of functions to...

6 years ago | 1

| accepted

Answered
How to store function output as a matrix?
out = zeros([],2); count = 0 ; for T = [0:10:100] Volume = [0.0735560; 0.0736893; 0.0738233; 0.0739572; 0.0740910;...

6 years ago | 0

| accepted

Answered
create an interpolated grid
% new interpolated grid lonx=min_x:20:max_x; laty=min_y:20:max_y; [Xi,Yi]=meshgrid(lonx,laty); bathymetry=interp2(XX,YY,ZZ,...

6 years ago | 1

| accepted

Answered
Slope of the linear(elastic) part of a stress-strain curve
Pick the required points (x,y) which fall in linear region. p = polyfit(x,y,1) ; m = p(1)

6 years ago | 2

Answered
Varying Random Number Generator between a Range
lb = [750,150,8,8]; ub = [850,250,15,15]; % id1 = randperm(length(lb),1) ; % select 1 lb randomly id2 = randperm(length(u...

6 years ago | 0

Answered
plot lines not showing up
You can save the generated values into a vector/ matrix and plot at the end. Check the below code: clc clear format long R=...

6 years ago | 0

| accepted

Answered
How to calculate Signal to noise ratio of multiple signals?
[m,n] = size(data) ; % where data is 2040*24 matrix S = zeros(n,1) ; for i = 1:n S(i) = snr(data(:,i)) ; end

6 years ago | 0

Answered
How to store the value of y in the loop being executed?
This is how you save y but you need to check your logic. % BPSK M = 2; % number of bi...

6 years ago | 1

Answered
Taking the partial derivative analytically and then evaluating at a specific (x,y,z) coordinate
Read about subs, double, vpa.

6 years ago | 0

| accepted

Answered
construct a vector formed by arrays of different lengths
a=cell(3,1); for i=1:3 a{i}=b(i)*ones(1,c(i)); end

6 years ago | 0

| accepted

Answered
Plotting the results of a 2d scan in grayscale
data = importdata("scannmatrix.txt") ; x = data(:,1) ; y = data(:,2) ; z = data(:,3) ; xi = unique(x) ; yi = unique(y) ...

6 years ago | 1

| accepted

Answered
import strings from file to matrix
fpath_audio_split = cell(5,1) ; for i = 1:5 fpath_audio_split{i} = strsplit(string(fpath_audio(i,1)),','); end

6 years ago | 1

| accepted

Answered
How to get the value of an element if it satisfies a logical condition ?
inpolygon gives you logical indices. From these you canget the points. Read about inpolygon and logical indexing. idx = inpoly...

6 years ago | 0

| accepted

Answered
Reducing the resolution of a matrix
Read about interp2. You have to do interpolation. https://www.mathworks.com/help/matlab/ref/interp2.html

6 years ago | 0

| accepted

Answered
Matrix division "in scalar way"
Read about element by element operations in MATLAB. https://www.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations...

6 years ago | 0

Answered
How i can build a Digital Elevation Model at a specific resolution from .xyz file?
It depends on whether your data is grdded or not gridded. Let A be your m*3 data. Check below options to proceed: x = A(:,1) ; ...

6 years ago | 1

| accepted

Answered
How to extract the Voronoi cells that fall inside ROI ?
Read about inpolygon. https://www.mathworks.com/help/matlab/ref/inpolygon.html

6 years ago | 0

Answered
Create a square matrix with a nested loop
A = zeros(4) ; A(1,:) = -20:2:-14 ; A(2,:) = -12:2:-6 ; A(3,:) = -4:2:2 ; A(4,:) = 4:2:10 ;

6 years ago | 0

Answered
How to Crop India shape file from Global shapefile
shpFile1 = "c1976_2000.shp" ; shpFile2 = "IND_ADM1.SHP" ; S1 = shaperead(shpFile1) ; S2 = shaperead(shpFile2) ; P1...

6 years ago | 0

| accepted

Answered
How to add 1 matrix to another matrix ?
A1 = rand(5,10) ; A2 = rand(5,10) ; A12 = [A1 ; A2] ; % join A1 and A2 into single matrix [m,n] = size(A12) ; % get the di...

6 years ago | 1

Answered
create binary image with specific parameters
You need to proceed somethings like this: nR = 100 ; nC = 100 ; I = zeros(nR,nC) ; I(50:60,50:60) = 1 ; % 50:60 are the ro...

6 years ago | 0

| accepted

Answered
plotting a graph on matlab
Read about element by element operations in MATLAB. clc; clear all; k=input('Enter constant k'); Ra=input('Enter resistence...

6 years ago | 0

Answered
Compare values and create new vector
It seems you want interp1. Let A be your m*2 matrix and B be n*1. iwant = interp1(A(:,1),A(:,2),B)

6 years ago | 1

| accepted

Answered
check if the entries of an array exists in another array
Read about ismember. [c,ia] = ismember(a1,a2) ; a1(c)

6 years ago | 4

| accepted

Answered
How to obtain a logical array?
idx = x==10

6 years ago | 0

| accepted

Load more