Answered

Same code in a loop but different plots

area also supports linestyle, none. load('sample.mat') thr = [0.0057 0.0401 0.0090 0.0216]; t = (0:length(sample)-1)/2000;...

Same code in a loop but different plots

area also supports linestyle, none. load('sample.mat') thr = [0.0057 0.0401 0.0090 0.0216]; t = (0:length(sample)-1)/2000;...

3 months ago | 1

Answered

Extracting text from a video

v = VideoReader('Large_Patron_Trim\Large_Patron_Trim.mp4'); N = v.NumFrames ; % Total number of rames ROI = [1008 215 50 3...

Extracting text from a video

v = VideoReader('Large_Patron_Trim\Large_Patron_Trim.mp4'); N = v.NumFrames ; % Total number of rames ROI = [1008 215 50 3...

3 months ago | 1

Answered

BAR GRAPH plot - grouped legend

Refer this: https://in.mathworks.com/matlabcentral/answers/1670649-bar-plot-with-a-hatched-fill-pattern?s_tid=srchtitle https...

BAR GRAPH plot - grouped legend

Refer this: https://in.mathworks.com/matlabcentral/answers/1670649-bar-plot-with-a-hatched-fill-pattern?s_tid=srchtitle https...

3 months ago | 1

Answered

Hatched Bar graph or Pattern bar graph

Refer this: https://in.mathworks.com/matlabcentral/answers/1670649-bar-plot-with-a-hatched-fill-pattern?s_tid=srchtitle

Hatched Bar graph or Pattern bar graph

Refer this: https://in.mathworks.com/matlabcentral/answers/1670649-bar-plot-with-a-hatched-fill-pattern?s_tid=srchtitle

3 months ago | 1

Answered

Average intensity of an image

A = magic(5) ; [m,n] = size(A) ; iwant = 0 ; for i = 1:m for j = 1:n iwant = iwant+A(i,j) ; end end iwan...

Average intensity of an image

A = magic(5) ; [m,n] = size(A) ; iwant = 0 ; for i = 1:m for j = 1:n iwant = iwant+A(i,j) ; end end iwan...

3 months ago | 1

Answered

Why am i recieveing only one output even though my input is a matrix

You need to use element by element operations. clc; clear all ; clear all close all %hertzian contact calculator for a spher...

Why am i recieveing only one output even though my input is a matrix

You need to use element by element operations. clc; clear all ; clear all close all %hertzian contact calculator for a spher...

3 months ago | 1

| accepted

Answered

How to use regression to find equation of data set?

x = [12 12.5 13 13.5 14] ; y = [61 61.5 62 62.5 63] ; [X,Y] = meshgrid(x,y) ; Z = [120 114 103 93 80 124 120 109 97 85 1...

How to use regression to find equation of data set?

x = [12 12.5 13 13.5 14] ; y = [61 61.5 62 62.5 63] ; [X,Y] = meshgrid(x,y) ; Z = [120 114 103 93 80 124 120 109 97 85 1...

3 months ago | 1

| accepted

Answered

My code is returning a complex array

There is a typo in your code. x = -10:1:10 ; y = zeros(size(x)) ; for j = 1:length(x) y(j) = power(2.72,-0.2*j); %<--...

My code is returning a complex array

There is a typo in your code. x = -10:1:10 ; y = zeros(size(x)) ; for j = 1:length(x) y(j) = power(2.72,-0.2*j); %<--...

3 months ago | 1

| accepted

Answered

i can not load load WaveformData

That matfile will be available in 2022b version. It seems you are using a lower version.

i can not load load WaveformData

That matfile will be available in 2022b version. It seems you are using a lower version.

3 months ago | 1

| accepted

Answered

2D interpolation of data

data = [1 1 7 2 3 9 3 5 8 4 6 4] ; x = data(:,1) ; y = data(:,2) ; z = data(:,3) ; F = scatteredInterpolant(x,y,z) ; xi...

2D interpolation of data

data = [1 1 7 2 3 9 3 5 8 4 6 4] ; x = data(:,1) ; y = data(:,2) ; z = data(:,3) ; F = scatteredInterpolant(x,y,z) ; xi...

3 months ago | 2

| accepted

Answered

how can I calculate ocean current speed from u and v data?

Let u and v be the components. s = sqrt(u.^2+v.^2)

how can I calculate ocean current speed from u and v data?

Let u and v be the components. s = sqrt(u.^2+v.^2)

3 months ago | 1

Answered

Using solution from vpasolve and syms for another function

A =[ 0 0 0 1.0000 0 0 0 0 0 0 1.0000 0 ...

Using solution from vpasolve and syms for another function

A =[ 0 0 0 1.0000 0 0 0 0 0 0 1.0000 0 ...

3 months ago | 1

| accepted

Answered

How can I make my code run faster?

c = zeros(size(d)) ; idx1 = d >= 0.05 ; c(idx1) = 1 ; idx2 = d < -0.05 ; c(idx2) = -1 ;

How can I make my code run faster?

c = zeros(size(d)) ; idx1 = d >= 0.05 ; c(idx1) = 1 ; idx2 = d < -0.05 ; c(idx2) = -1 ;

3 months ago | 1

| accepted

Answered

repetitive looping and plotting

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1175788/newdata3.csv') ; data = reshape(T.(2),6000...

repetitive looping and plotting

T = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1175788/newdata3.csv') ; data = reshape(T.(2),6000...

3 months ago | 1

| accepted

Answered

Interpolation of missing matrix element

M = [43.13 0 42.88;0 39.32 0;41.81 0 43.27]; M(M==0) = NaN M = fillmissing(M,'linear') M = fillmissing(M','linear')'

Interpolation of missing matrix element

M = [43.13 0 42.88;0 39.32 0;41.81 0 43.27]; M(M==0) = NaN M = fillmissing(M,'linear') M = fillmissing(M','linear')'

3 months ago | 1

| accepted

Answered

How to separate points under a line in a scatter plot

Refer the theory here: https://www.emathzone.com/tutorials/geometry/position-of-point-with-respect-to-line.html %Importing xy ...

How to separate points under a line in a scatter plot

Refer the theory here: https://www.emathzone.com/tutorials/geometry/position-of-point-with-respect-to-line.html %Importing xy ...

3 months ago | 1

Answered

Why am not getting any graph?

clc; clear all ; clc; clear; syms p; x = 13.61015; y = 13257; a = 5.14; b = 11.47; err1 = 0.000001; f = (x^3 + p^2*x^2 ...

Why am not getting any graph?

clc; clear all ; clc; clear; syms p; x = 13.61015; y = 13257; a = 5.14; b = 11.47; err1 = 0.000001; f = (x^3 + p^2*x^2 ...

3 months ago | 1

Answered

How to use importdata to import the data from a csv file

Read about readtable.

How to use importdata to import the data from a csv file

Read about readtable.

3 months ago | 1

Answered

Unidentified variable or function of x

function x=cake(p,q,x) a=diff(p,x) b=diff(q,x) c=exp(-1*int(p,x)) p2=diff(((a+b)*c),x)/((a+b)*c) q2=((a+b*c)*(-c)) r2=...

Unidentified variable or function of x

function x=cake(p,q,x) a=diff(p,x) b=diff(q,x) c=exp(-1*int(p,x)) p2=diff(((a+b)*c),x)/((a+b)*c) q2=((a+b*c)*(-c)) r2=...

3 months ago | 1

| accepted

Answered

How do I merge squares

T= [1 2 3 4 5 6] ; iwant = num2cell(T,2) ; iwant{1} iwant{2}

How do I merge squares

T= [1 2 3 4 5 6] ; iwant = num2cell(T,2) ; iwant{1} iwant{2}

3 months ago | 1

| accepted

Answered

I don't know how to code this number triangle

n = [1 11 111 1111 11111 111111 1111111]; for i = 1 : length(n) x = num2str(n(i)^2); s = [blanks(length(n)-i) x]; ...

I don't know how to code this number triangle

n = [1 11 111 1111 11111 111111 1111111]; for i = 1 : length(n) x = num2str(n(i)^2); s = [blanks(length(n)-i) x]; ...

3 months ago | 1

| accepted

Answered

Hi, I have data of temperature that need normalized, subtract by the mean temperature and divide by its standard deviation

If T is your array; just do: T_normalized = (T-mean(T))/std(T) ;

Hi, I have data of temperature that need normalized, subtract by the mean temperature and divide by its standard deviation

If T is your array; just do: T_normalized = (T-mean(T))/std(T) ;

3 months ago | 2

Answered

How to define plane in 3d cube. Intersection point of segment with plane in 3d cube

You define p0, p1, p2 and p3 as matrix arrays. function [I] = check_planes(x0,x1) p0 = zeros(1,3,6) ; p1 = zeros(1,3,6) ; ...

How to define plane in 3d cube. Intersection point of segment with plane in 3d cube

You define p0, p1, p2 and p3 as matrix arrays. function [I] = check_planes(x0,x1) p0 = zeros(1,3,6) ; p1 = zeros(1,3,6) ; ...

3 months ago | 1

| accepted

Answered

Error using + Matrix dimensions must agree., can someone help me?

clear all; [Y,Fs] = wavread('here.wav'); Fs = 16000;%nilai default Fs=16000 %sound(Y,Fs) noise = randn(size(Y)); Y_noise = ...

Error using + Matrix dimensions must agree., can someone help me?

clear all; [Y,Fs] = wavread('here.wav'); Fs = 16000;%nilai default Fs=16000 %sound(Y,Fs) noise = randn(size(Y)); Y_noise = ...

3 months ago | 1

Answered

How to read a table.txt from series of folders?

This question is asked multiple times. You may refer links: https://in.mathworks.com/matlabcentral/answers/401204-how-do-i-read...

How to read a table.txt from series of folders?

This question is asked multiple times. You may refer links: https://in.mathworks.com/matlabcentral/answers/401204-how-do-i-read...

3 months ago | 1

Answered

aviread MATLAB function not found

It is not an inubilt function. Download the function from here: https://in.mathworks.com/matlabcentral/fileexchange/18559-avire...

aviread MATLAB function not found

It is not an inubilt function. Download the function from here: https://in.mathworks.com/matlabcentral/fileexchange/18559-avire...

3 months ago | 1

Answered

Convert a struct with multiple fields into spreadsheet

REad about struct2table. After conversion write it into excel/ spreadsheet using writetable.

Convert a struct with multiple fields into spreadsheet

REad about struct2table. After conversion write it into excel/ spreadsheet using writetable.

3 months ago | 1

Answered

how to find f(x) when f(1) is given

g'(x) would be: g'(x) = f'(x)/x^3-3*f(x)/x^4 ; % remember uv rule So in the above substitute the given values: g' = 4/1^3-3...

how to find f(x) when f(1) is given

g'(x) would be: g'(x) = f'(x)/x^3-3*f(x)/x^4 ; % remember uv rule So in the above substitute the given values: g' = 4/1^3-3...

3 months ago | 0

| accepted