Community Profile

photo

Chunru


Last seen: Today

DSO National Laboratories

427 total contributions since 2013

Matlab user since 1990

Contact

Chunru's Badges

  • MATLAB Central Treasure Hunt Finisher
  • Revival Level 1
  • Knowledgeable Level 3
  • First Answer
  • Indexing I Master
  • Commenter
  • Sequences And Series II Master
  • Speed Demon
  • Creator
  • Sequences And Series I Master
  • Cody Challenge Master
  • Introduction to MATLAB Master
  • CUP Challenge Master
  • Strings I Master
  • Project Euler I

View all

Contributions in
View by

Answered
Matlab less than comparison
The correct way should be: cA(i+1,:) = max(cA(i+1,:), NC); or idx = cA(i+1,:) <NC; cA(i+1, idx)=NC;

environ 3 heures ago | 0

Answered
How to get 2d slices from a 3D image.
From 'doc slice': [X,Y,Z] = meshgrid(-2:.2:2); V = X.*exp(-X.^2-Y.^2-Z.^2); % replace this with your 3D data xslice = [-...

environ 4 heures ago | 0

Solved


7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (see Wikipedia: <http://...

environ 4 heures ago

Solved


Convert Roman to Arabic Numerals
Based upon what I see on tv and at the movies, the use of Roman numerals indicates something is important or sophisticated (e.g....

environ 4 heures ago

Solved


Math with Roman Numerals
Given a function R within (+,-,*,/) and two Roman numerals a & b, compute aRb in Roman numerals.

environ 4 heures ago

Solved


Test if a Number is a Palindrome without using any String Operations
*Description* Given an integer _X_, determine if it is a palindrome number. That is, _X_ is equal to the _X_ with the digits ...

environ 4 heures ago

Solved


Increment a number, given its digits
Take as input an array of digits (e.g. x = [1 2 3]) and output an array of digits that is that number "incremented" properly, (i...

environ 5 heures ago

Solved


Must be in the front row...
You are given a matrix followed by a single number. Your object is to write a script that will shift the matrix around so that ...

environ 5 heures ago

Answered
how to calculate PSNR value of two color images?
Try the following: doc psnr

environ 24 heures ago | 0

Answered
Could anyone help me how to change the values of the matrix to a desired range.
Something like this: N = 10 X = zeros(N); X(1:2,:) = 1; X(3:4, 3:end)=2; X(5:6, 5:end)=3; X(7, 7:end)=5; X(8, 9:end)=6; ...

environ 24 heures ago | 0

Solved


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

1 jour ago

Solved


Back to basics 12 - Input Arguments
Covering some basic topics I haven't seen elsewhere on Cody. Return a value equal to the number of input arguments to the fun...

1 jour ago

Solved


Factorial Numbers
Factorial is multiplication of integers. So factorial of 6 is 720 = 1 * 2 * 3 * 4* 5 *6 Thus 6 factorial = factorial(720)....

1 jour ago

Solved


Reverse a matrix
Its simple. You have to reverse a given matrix.

1 jour ago

Solved


02 - Vector Variables 2
Make the following variable: <<http://samle.dk/STTBDP/Assignment1_2b.png>>

1 jour ago

Solved


MATLAB Basic: rounding
Do rounding near to zero Example: -8.8, answer -8 +8.1 answer 8

1 jour ago

Solved


Determine if a Given Number is a Triangle Number
*Description:* Determine if the elements of an input array are triangle numbers and return the result as an array with the sa...

1 jour ago

Answered
Computing 4th cumulant of Gaussian variable
When number of samples is sufficiently large, the sample mean (your fucntion output) is approaching to the true expected value (...

1 jour ago | 0

Answered
Change colour of line graph once a value is reached
The program is slow because it draws and updates the line segment (of two points) by segment . To speed up in the simplest way,...

1 jour ago | 0

| accepted

Answered
solving the Transfer function
% Divide G(s) into two parts (or manually simplify it) h1 = tf([0.02 1], [0.005 1 0 0 0]); h2 = tf([0.025 1], [0.001 1]); g =...

2 jours ago | 1

| accepted

Answered
I need to create a nested struct from nested folders
% List all the file in current folder and subfolders fn = dir('**/*'); % structure for the information of all the file % f...

3 jours ago | 0

| accepted

Solved


Replace Nonzero Numbers with 1
Given the matrix x, return the matrix y with non zero elements replaced with 1. Example: Input x = [ 1 2 0 0 0 ...

3 jours ago

Solved


Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix Example ...

3 jours ago

Solved


A matrix of extroverts
Now that the introverts have had their script, the extroverts spoke up (naturally!) and demanded one as well. You will be given...

3 jours ago

Solved


Convert matrix to 3D array of triangular matrices
Given a 2D numeric array x in which each column represents the vectorized form of an upper triangular matrix, return a 3D array ...

3 jours ago

Answered
Running the Same code for Multiple Files in a Folder
Here is a schetch of the solution: fn = dir('a*.txt'); % obtain the file information 'a*.txt'. make your own modification for...

3 jours ago | 0

Answered
issue when creating and saving file to specific folder
When dataFolder is a variable, change directory with the following statement: cd(dataFolder) ;

3 jours ago | 1

Solved


Too Many Zeros, Dump Them!
Sometimes when I create a matrix, I use this syntax: a = zeros(1000,1000); But when the function ends, I find that I don'...

3 jours ago

Solved


Enlarge array
Given an m-by-n numeric array (A) and a 1-by-2 vector (sz) indicating the dimensions [p q] to enlarge each element, return an (m...

3 jours ago

Solved


Remove entire row and column in the matrix containing the input values
Remove the entire row and column from the matrix containing specific values. The specified value can be a scalar or a vector. Fo...

3 jours ago

Load more