Risposto
Question regarding arranging matrix values
% a 22*1 matrix with end values zeros. x = rand(22, 1); x(end-5:end)=0; x % the last two zeros to occupy the first two row...

oltre 2 anni fa | 0

Risposto
Color scale of scatter plot?
x = randn(100, 1); y = randn(100, 1); cmap = parula(512); cmap = cmap(1:360, :); % dark blue to green (360 colors) pos_...

oltre 2 anni fa | 0

Risposto
How to get a line plot
x=[25 45]; y=[200 200] plot(x,y,Color='black') axis([20 50 100 400])

oltre 2 anni fa | 0

| accettato

Risposto
not displaying eval in command window
Try this: for i =1 : length (signal_names) ImportedSignals = genvarname(cell2mat(signal_names(i)), who); eval([Import...

oltre 2 anni fa | 0

| accettato

Risposto
intersection points between two curves
% These are the Input parameters used w = 60; h = 350; T0 = 60; rho = 600; T= 3.175; N...

oltre 2 anni fa | 0

Risposto
Calculate mahalanobis distance of matrix for each row
A = [110 -100 0; 100 -100 0; 10 0 0; 0 10 0; 0 -10 20; 0 -10 10; 0 0 10;-10 -10 -10; -10 0 0]; mean_row = mean(A,1); whos d =...

oltre 2 anni fa | 0

| accettato

Risposto
how to add two binary digits of 8bit size?
a = '01001011'; b = '00100011'; c = '00000000'; % Cosider a carry bit carry = 0; % loop through from last bit to first ...

oltre 2 anni fa | 0

| accettato

Risposto
select only one value every four (or different numbers) in an array
a = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16] b = a(4:4:16)

oltre 2 anni fa | 1

| accettato

Risposto
How can I arrange a vector in ascending order
D = [3 6 7 2 -4 7 3 2 ] D1 = sort(D)

oltre 2 anni fa | 0

| accettato

Risposto
Calculate covariance matrix for simple example
format longg temp = [1 2 4 2 5; 100 300 200 600 100; 10 15 20 10 30]; res = cov(temp.')

oltre 2 anni fa | 0

| accettato

Risposto
How to start two plots with different origins.
p1 = [0 0]; % inital position for object 1 p2 = [2000 0]; v1 = [150 20]; % initial velocity for object 1 v2 = [-80 30...

oltre 2 anni fa | 1

| accettato

Risposto
pdf file direct download
url = "https://www.mathworks.com/help/pdf_doc/matlab/learn_matlab.pdf"; tic urlwrite (url, 'learn_matlab.pdf'); toc dir

oltre 2 anni fa | 0

Risposto
How can i use string values saved in a cell array as variable names in a for loop.
You can put the result in a struct with field names corresponding to your Dist_type load Test_Data.mat Dist_type = {'Kernel', ...

oltre 2 anni fa | 0

| accettato

Risposto
To usa counties and state mape and shade with different color
warning off states = shaperead( 'usastatehi.shp'); % MATALB comes with usa states map .shp file You can download the county l...

oltre 2 anni fa | 0

| accettato

Risposto
Generating Geometry Patterns at Scale
What does flattenong the plot of the red polygon mean? xCenter = 10; yCenter = 10; % Modification to the FAQ is the next two ...

oltre 2 anni fa | 0

Risposto
how do i find the min value using for loop?
syms x smin = inf; % initialize smin for yr = linspace(0,1,10) f = sin(x); fL = [0 pi]; iL = [0 pi]; ...

oltre 2 anni fa | 0

| accettato

Risposto
Converting a 2d array into a 3d array
"it is taking lot of time" for what size of array? m=200; n=100; Z_int = rand(m, n); Z = nan(m,m,n); tic for i = 1 : size(...

oltre 2 anni fa | 0

Risposto
How Can I determine minimum value in a double array?
vect =[ 2.6660 2.2852 10.0000 3.2617 10.0000 10.0000 9.8532]; [vmin, idx] = min(vect)

oltre 2 anni fa | 0

Risposto
I want to colour the area between red line and black line below the intersection point. how am i going to do it?
c=[3,5]; A=[1,2;1,1;0,1]; b=[2000;1500;600]; y1=0:1:max(b); x21=(b(1)-A(1,1)*y1)./A(1,2); x22=(b(2)-A(2,1)*y1)./A(2,2); x2...

oltre 2 anni fa | 1

Risposto
How to vectorize the function?
fc=1e+8; % carrier fm=1e+3; % modulate fd=7.5e+4; % frequency deviation r=0.25; t0=0.0005; % reflection and delay w0=2*pi...

oltre 2 anni fa | 1

Risposto
How do I move an item in an array to the end of that array?
T = [1 5 77 10 15 20 25 33]; T1 = sort(T) % Method 1 T2 = T([1:2 4:end 3]) % Method2

oltre 2 anni fa | 0

Risposto
How to set x axis in a plot?
subplot(6,1,1:5); imagesc([1 8], [14, 22], randi(100,100)); subplot(8,1,8); imagesc([1 8], 1, [1 2 2 2 2 2 2 3 3]); set(gca, ...

oltre 2 anni fa | 0

| accettato

Risposto
How to create a moving average filter to a specific signal
x = readmatrix("2013.txt"); n = 7; % filter order y = filter(ones(n, 1)/n, 1, x); plot(x); hold on; plot(y); legend('Or...

oltre 2 anni fa | 0

Risposto
use matlab code to draw the joint PMF and CDF
[x, y] = meshgrid([0 1], [0 1]) z = [0.25 0.5; 0.125 0.125]'; stem3(x, y, z) xlabel('x'); ylabel('y'); zlabel('p')

oltre 2 anni fa | 0

Risposto
Extract Tables from within a cell
s = load("Tables") % i-th tables i = 1; t = s.Tables{i}

oltre 2 anni fa | 0

| accettato

Risposto
Populating a vector between upper and lower bound?
e0 = 0; % Initial strain values e_max = 4; % Max strain values inc = 1; % +ve increase, -ve decrease e_t ...

oltre 2 anni fa | 0

| accettato

Risposto
same number in the vector
h=[0.12;0.1;0.1;0.04;0.04;0.04;0.1;0.1;0.1;0.06;0.1] hu = unique(h); idx = sum(h -hu' == 0) > 1; hrep = hu(idx)

oltre 2 anni fa | 0

| accettato

Risposto
cluster points within given radius
n = 300; R = 350; x0 = 50; % Center of the circle in the x direction. y0 = 90; % Center of the circle in the y direction. an...

oltre 2 anni fa | 0

Risposto
Subplot with Geoaxes.
"geoaxes" cannot be the child of subplot. But we can set its position as follows (2x2 grid for example): for i=1:2 for j...

oltre 2 anni fa | 0

Risposto
Getting the a day of a month based on Vac(day,month)
calendar(2021, 3)

oltre 2 anni fa | 0

Carica altro