Community Profile

photo

Chunru


Last seen: Today Active since 2013

Matlab user since 1990

Statistics

All
  • Treasure Hunt Participant
  • MATLAB Central Treasure Hunt Finisher
  • 12 Month Streak
  • Guiding Light
  • Number Manipulation I Master
  • Indexing I Master
  • Revival Level 2
  • Knowledgeable Level 5
  • Commenter
  • Sequences And Series II Master
  • Speed Demon
  • Creator

View badges

Content Feed

View by

Answered
Getting "Unrecognized function or variable 'reshape'" error!!
%reshape([1 2 3 4],:,1); reshape([1 2 3 4], [], 1) % use [] for auto computed size

8 hours ago | 0

Answered
create 256* 256 matrix with loop values 0 to 7
x = repmat(0:7, 256, 32)

1 day ago | 0

| accepted

Answered
In the follow screenshot why do we use this filter to our signal I ?
You have a discrete linear system. You could find the system transfer function by analysing the system. It turns out to be a f...

1 day ago | 0

Answered
Extracting data from confusion matrix fig
f = openfig('SqueezeNet-CM', 'visible'); h = findobj(f.Children(2).Children, 'Type', 'Text'); data = zeros(length(h), 1); for...

1 day ago | 0

Answered
How to write Exponential growth
x1 = logspace(0, 5, 11) % 11 points btw 10^0 and 10^5 in log space x2 = 10.^(0:.5:5)

2 days ago | 0

Answered
I am trying to figure out how to plot my data.
Data101 = linspace(0,10,500); red_line = sin(2*pi*Data101)*1.5; for i = 1:length(Data101) if red_line(i) >= 0.95 && red_l...

3 days ago | 0

| accepted

Answered
How to extract multiple 'y' axis values with respect to 'x' axis from .fig file
The figure is likely produced using fplot. The appropriate object handle is of type "ImplicitFunctionLine". f=openfig('imp.fig'...

3 days ago | 0

| accepted

Answered
Plotting a time domain Signal
N=256; f=(0:N-1)/N; xf = 2*sinc(2*f); % 2*sin(w)/w => 2*sinc(2*f) x_i=ifft(xf); plot(f, real(x_i), 'r', f, imag(x_i), '...

3 days ago | 0

Answered
RMSE heart rate estimation
hrerror = randn(100, 1); % generate some random data hr_rmse =rms(hrerror) % use rms function hr_rmse1 = sqrt(mean(hr...

3 days ago | 0

| accepted

Answered
Shade between lines in log-y scale not properly plot
load data_ecdf figure(1) % just to view the expected filled area semilogy(eOut.psSST, eOut.sSST);grid on;ylabel('mg/L');hold o...

3 days ago | 0

| accepted

Answered
my DCT2 algorithm results in blank image, please help
A = rgb2gray(imread('Lenna.png')); figure; imshow(A); whos B = zeros(64,64); for i = 1:64 for j = 1:64 %Split ...

4 days ago | 0

Answered
Import numeric data from mixed txt file
a = readtable('data.txt', 'CommentStyle', '#')

4 days ago | 0

Answered
ifft2 with "symmetric option"
Let F(u, v) be the forward FFT2 of f(x, y). For real function f(x,y), FT exhibits conjugate symmetry, i.e. F(u, v) = F*(-u, -v...

4 days ago | 0

Answered
Auto adjust y axis with imhist
img = imread('cameraman.tif'); subplot(2,3,1) image(img) colormap('gray') subplot(2,3,2) imhist(img); ylim auto

4 days ago | 0

Answered
Error using freqz, 6 columns needed to be a valid SOS matrix
freqz is for filter response. use fft or pwelch (or other spectrum estimator) for ploting spectrum of signal. %Generate Sound ...

4 days ago | 0

Answered
Error in matrix assignment
The image from the file "img" has a size of 256-by-256. However, you have defined the img_stack with size of 128-by-128-by-#of_...

8 days ago | 1

| accepted

Answered
Hypothetical Factorial Question Solution
x = 120; nfact = 1; for i = 1:x nfact = nfact*i; if nfact==x fprintf("%d = %d!\n", x, i) break ...

9 days ago | 0

Answered
Invert even and odd columns in an image
a = randn(10, 10, 3); imshow(a) % swap even and odd columns b = zeros(size(a)); b(:, 1:2:end, :) = a(:, 2:2:end, :); b(:, 2...

9 days ago | 1

Answered
why I receive this error "Array indices must be positive integers or logical values"?
gamma = 0.5; beta = 0.9; w = 0.3; r = 1.2; [c1star] = c1a(w,r,gamma,beta) function c1a = c1a(w,r,gamma,beta) % ...

9 days ago | 0

| accepted

Answered
Can I remove zeroth order baseline?
raw = readtable('raw.xlsx'); Xcontractions = raw.rXcont; Ycontractions = raw.rYcont; Time = raw.Time; %% Low-pass filter ...

10 days ago | 0

| accepted

Answered
Multiple bar plot of different datasets in the same figure
x = rand(6,2); b = bar(x); % control the color of individual bar % 1st group first bar b(1).FaceColor = 'flat'; b(1).CDat...

10 days ago | 1

| accepted

Answered
FFT Amplitude and FFT Normalization
There are different ways of interpreting the FT. Here is one way according to Parseval's theorem: or The LHS of the firs...

10 days ago | 2

Answered
I need ziggurat matlab code to draw
where is a normalizing constant that we can ignore. x = [0:.1:2] y = 1/(2*pi)*exp(-x.^2/2); stairs(x, y, 'b'); hold o...

10 days ago | 0

| accepted

Answered
Find the variation of x(t)
syms x(t) Dx = diff(x, t); eqn = diff(Dx, t) + 7* Dx + 5*x == 8 cond = [x(0)==1, Dx(0)==2]; y = dsolve(eqn, cond) fplot(y, ...

10 days ago | 0

| accepted

Answered
matlab solver with respect to x^2
syms x a y equ1=x^2+x^4==a equ2 = subs(equ1, x^2, y) S=solve(equ1,x) Sx2 =solve(equ2) subs(Sx2, a, 1)

14 days ago | 0

Answered
How to count the number of white pixels
First, you should use gray scale image. Second you have a large white margin in your data (which is not seen from imshow). You...

15 days ago | 1

| accepted

Answered
How to plug in algebraic equation and solution for it?
It seems that the equation you give has no soltion. f = @(t) 3.7 *( 1 + 4.1*.006/170*(3.7/180)^(2/3) * nthroot(t.^5, 3)).^-1.5;...

15 days ago | 0

Answered
removing some data in a 4d plot
data = load('4dplot.txt'); % x = 4dplot(:,1); % wrong: variable names canno start with number x = data(:,1);...

16 days ago | 1

Answered
How to convert a text file into a table properly
Try this: fid = fopen('test.txt', 'r'); fgetl(fid); % skip the header i=1; x = []; while ~feof(fid) s = fgetl(fid); ...

16 days ago | 0

Answered
What optimizer should I use?
Consider your objective function f(T, R1, R2), whose dependence on R2 lies on the first term only. To minimise f, R2 need to ...

16 days ago | 0

Load more