Community Profile # Chunru

Last seen: Today Active since 2013

Matlab user since 1990

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

Plot time-series data of various column

1 day ago | 0

| accepted

Function won't display output in command window
You have to save the function as "funfactorial.m" first (not Untitled.m).

2 days ago | 0

| accepted

Becasue the range of data is too big, the displayed result using the default format may make the smaller value to be 0. Run the...

2 days ago | 0

I cannot figure out how to get my data to plot on a simple line graph.
data = readmatrix('Copy of Pop Up.csv'); x = data(:, 1); y = data(:, 3); plot(x, y); % plot('Year','Num_corals') ...

2 days ago | 0

Can my x-axis have varying scales for certain ranges of values?
Yes. You can change the tick locations: t = 1:200; x = sinc(2*pi*.125*t); plot(t, x); set(gca, 'XTick', [0:20:60 70:10:100 ...

2 days ago | 0

Why won't my plot line show in plot?
W_dot_net = 3; % a constant n_c = linspace(0.6,0.8,10); % The following can be vectorized and simplified. But the loop f...

2 days ago | 0

how do I make script that plots values from workspace dividing into the case
x = randn(101, 1); y = randn(101, 1); idx = x.*y > 0; % same signs plot(x(~idx), y(~idx), 'ro'); grid on

3 days ago | 0

| accepted

Double Integration error using /
Keep in mind that the function should be defined for vector arguments x and y. Therefore some * and / should be changed to .* a...

3 days ago | 1

| accepted

Can one install two matlab versions in one machine?
Yes. As long as you have space, you can install new version along with old versions.

3 days ago | 0

Plotting combined and separated graphs for nested for loops
for n = 2:10 figure; hold on for j = 1:10 plot(x,y(:,n,j)); end hold off end

3 days ago | 0

| accepted

Generate repeatable random integers within a fixed range
a = randi([4 11], 4, 1)

3 days ago | 0

finding the values of X for a given Y in an equation
syms x y solve(x^4+x^2 == 3)

3 days ago | 0

| accepted

How to create a nested cell file?
DATA(5).A.B.C=rand(12,31); DATA(1) DATA(5)

3 days ago | 0

Make a logical array into a single logical column, if any of the array rows contain a 1
a = [0 0 0; 1 0 0; 0 1 0; 0 0 0] b = any(a==1, 2)

4 days ago | 1

| accepted

How to find a y value for a given x in a plot?
x1 = 25; y1 = interp1(t1, p1, x1);

4 days ago | 0

| accepted

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...

4 days ago | 0

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_...

5 days ago | 0

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

5 days ago | 0

| accepted

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

5 days ago | 0

| accepted

How can I find the intersection points between two curves and area between these curves?
% These are the Input parameters used w = 60; h = 350; T0 = 60; rho = 600; T= 3.175; N...

5 days ago | 0

| accepted

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 =...

5 days ago | 0

| accepted

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 ...

5 days ago | 0

| accepted

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)

5 days ago | 1

| accepted

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

5 days ago | 0

| accepted

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.')

5 days ago | 0

| accepted

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...

5 days ago | 1

| accepted

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

5 days ago | 0

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', ...

5 days ago | 0

| accepted