Community Profile

photo

Chunru


Last seen: 1 día ago Active since 2013

Matlab user since 1990

Statistics

All
  • MATLAB Central Treasure Hunt Finisher
  • 6 Month Streak
  • Pro
  • Number Manipulation I Master
  • Indexing I Master
  • Knowledgeable Level 4
  • Revival Level 1
  • Commenter
  • Sequences And Series II Master
  • Speed Demon
  • Creator
  • Sequences And Series I Master

View badges

Content Feed

View by

Answered
How can I add sinusoidal signal and fft?
fs = 1000; f = [40 80 100 250]; % freq a = [1 2 3 1]; % amp p = randn(1,4)*2*pi; % phase t = (0...

alrededor de 20 horas ago | 0

| accepted

Answered
How to view image from .MAT file
x = load("1.mat"); x.cjdata figure(1); imagesc(x.cjdata.image); axis image saveas(gcf, 'a.jpg'); figure(2); imagesc(x.cjdata...

alrededor de 21 horas ago | 0

| accepted

Answered
Can you exclude dates in date range using xlim?
dn = now + [0:.5:48]/24; y = randn(size(dn)); subplot(311) plot(dn, y) datetick('x') subplot(312) idx = hour(dn)>7 &...

alrededor de 22 horas ago | 0

| accepted

Answered
Modulus Arithmetic Function Not Working
715^17 is too big. You can use symbolic computation: r=rem(sym(715)^17,2773)

alrededor de 24 horas ago | 0

| accepted

Answered
Storage results in an array
% Without loop x=[2,3,4,5,6]; y=x; y(x>4)=x(x>4).^2; y(x<=4)=x(x<=4)+2 % With loop x = [2,3,4,5,6]; y = zeros(size(x)); ...

alrededor de 24 horas ago | 0

Answered
programme matlab pour calculer et trace l'histogramme d'une image
I = imread('pout.tif'); imhist(I)

1 día ago | 0

Answered
Matrix Multiplication for each row
n = 5; %100000 A = randn(n, 2); B = [4 2; 2 3]; if n<100 d1 = diag(A*B*A') end d2 = sum(A.*(A*B'), 2)

1 día ago | 0

| accepted

Answered
Plotting pie charts over GraphPlot
Here is the updated answer. We play with the properties of pie_chart this time. clf s = [1 1 1 1 2 2 3 4 4 5 6]; t = [2 3 4 ...

3 días ago | 1

| accepted

Answered
How to change the position of labels on plot?
Add a number to z in "text" command. data = [1,0,3.8*10^8 2,1,4.2*10^7 3,2,1.5*10^7 4,3,7.8*10^7] ; x = data(:,1) ; y = ...

3 días ago | 0

| accepted

Answered
Plotting over a Range of Values
Use the array operator .* ./ .^2 for arrays. altitude = 150:1:1000; mu_earth = 3.986*10^5; %km3/s2 orbital_speed = sqrt(mu_ea...

3 días ago | 0

| accepted

Answered
Fitnet: Out of memory error solved by transposing?
When you use "my_ANN = train (net_set, input,output)", your network will have a input/output size of 49736, which results in man...

3 días ago | 1

| accepted

Answered
How can I only select table data from a text file.
a=readmatrix('G2_A.txt', 'NumHeaderLines',8)

5 días ago | 0

Answered
Removing commas between columns in text data
test = {'Sometimes, ,, I, use, commas, .' 'I, like, writing, ,, I, like, reading'}; test = regexprep(test, ',\s', ' ') ...

6 días ago | 0

Answered
Show limited digits numbers.
You can use fprintf with format specifier to format the print out. "doc fprintf". A=2.54357766; fprintf('%.6f\n', A);

6 días ago | 0

Answered
Change string words to number in table
% Assume the column has the data x.omst=["Clouds"; "Rain"; "Clear"] % You can use the categorical data x.omst = categorical(x...

7 días ago | 0

| accepted

Answered
Deleting unnecessary values in numerical array
% Assume that your data in second column is sorted. x = [ 1420 1 1410 1 1400 1 1390 0.9 1380 0.8 1370 0.7 1300 0 1290 0...

7 días ago | 0

| accepted

Answered
99x99 matrix
% For time comparison: n = 1000; timeit(@() bidiag1(n)) timeit(@() bidiag2(n)) timeit(@() bidiag3(n)) function bidiag1(n)...

7 días ago | 0

Answered
99x99 matrix
n = 9; %99 A = eye(n); A(n:n-1:n*n-1) = 1; % anti-diagonal A

7 días ago | 0

Answered
How can I generate a square lattice undirected graph?
n = 10; A = delsq(numgrid('S',n+2)); G = graph(A,'omitselfloops'); h = plot(G); h.XData = floor((0:99)/10); h.YData = rem((...

7 días ago | 0

| accepted

Answered
add an line for the coasts of the continents used for the geodensityplot in the mapping toolbox
mapping toolbox has the convention of lat-lon coordinates rather than lon-lat. try the following in your code: lon = linspace(...

7 días ago | 0

| accepted

Answered
How can I add more colors to semilogy?
plot(rand(30,20)+(1:20)); % plot 20 lines legend % The following line will change the default ColorOrder (7 colors) % change...

9 días ago | 0

Answered
how to change the front size and the inclination in a bar graph
h = gca; h.XTickLabelRotation = 0; % not recommended for long string h.TickLabelInterpreter = 'none';

10 días ago | 0

Answered
How do i remove conj from differention?
clear all syms x v s a y z r t real syms x(t) y(t) assumeAlso([y(t),x(t)],'real') A=[x, diff(y(t),t), s; y, z, r; s x(...

11 días ago | 0

| accepted

Answered
How to change the values of both axes
%Define variables sigma = 35*10^6; young_modulus = 90*10^9; strain_coefficient = 6*10^-9; magnetic_field = linspace(0, 16000...

11 días ago | 0

Answered
Selecting files from a directory
sims = pwd; %uigetdir ('C:\Matlab') save test.in sims % create a file info = dir(fullfile(sims,'*.in')) list = {info(~[info...

11 días ago | 0

| accepted

Answered
fit function does not work correctly
If the StartPoint is good enough, you can get the correct fitting. t = [0:0.01:6]'; %Test with a cosinus function y = cos(t*3...

11 días ago | 0

Answered
Display values of each element in imagesc
c = randi([0 40], [16 16]); heatmap(c); colormap(jet(512))

11 días ago | 0

| accepted

Answered
How to plot this frequency graph?
load runoff load precipitation precipitation = normalize(precipitation, 'range'); runoff = normalize(runoff, 'range'); histo...

12 días ago | 1

| accepted

Answered
How can I extract the values form the cell array?
Obviously, you don't have a matlab cell array (is it a python array?). The matlab array may look like the following: a(1).name...

12 días ago | 0

| accepted

Answered
Find the index of a value closest to a constant value in 3D array when the index of row and column are given
B(:,:,1) =[ 1 2 4 2 7 8 9 0]; B(:,:,2) =[ 9 2 4 7 0 1 2 ...

13 días ago | 0

| accepted

Load more