edward holt
Followers: 0 Following: 0
Feeds
문제를 풀었습니다
Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.
4년 초과 전
문제를 풀었습니다
Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...
4년 초과 전
문제를 풀었습니다
Return the largest number that is adjacent to a zero
This example comes from Steve Eddins' blog: <http://blogs.mathworks.com/steve/2009/05/27/learning-lessons-from-a-one-liner/ Lear...
4년 초과 전
문제를 풀었습니다
Find the longest sequence of 1's in a binary sequence.
Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...
4년 초과 전
질문
Row & Column Wise Normalisation
Objective: Normalise a matrix such that all rows and columns sum to 1. The below normalises each column, then row and repeats u...
4년 초과 전 | 답변 수: 1 | 1
1
답변문제를 풀었습니다
Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...
4년 초과 전
문제를 풀었습니다
Remove all the consonants
Remove all the consonants in the given phrase. Example: Input s1 = 'Jack and Jill went up the hill'; Output s2 is 'a ...
4년 초과 전
문제를 풀었습니다
Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Inpu...
4년 초과 전
문제를 풀었습니다
Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...
4년 초과 전
문제를 풀었습니다
Who Has the Most Change?
You have a matrix for which each row is a person and the columns represent the number of quarters, nickels, dimes, and pennies t...
4년 초과 전
문제를 풀었습니다
Column Removal
Remove the nth column from input matrix A and return the resulting matrix in output B. So if A = [1 2 3; 4 5 6]; ...
4년 초과 전
문제를 풀었습니다
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
4년 초과 전
문제를 풀었습니다
Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...
4년 초과 전
문제를 풀었습니다
Make a checkerboard matrix
Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1,1) should be 1. Examp...
4년 초과 전
문제를 풀었습니다
Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...
4년 초과 전
문제를 풀었습니다
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...
4년 초과 전
문제를 풀었습니다
Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...
4년 초과 전
답변 있음
How to set x axis using xticks?
xlim([0 24]) Sets the limits of the axis to run from 0 - 24 xticks([]) governs where there are tick marks.
How to set x axis using xticks?
xlim([0 24]) Sets the limits of the axis to run from 0 - 24 xticks([]) governs where there are tick marks.
4년 초과 전 | 0
답변 있음
how to create a function, and make the function to take items as its only parameter
The below should do it. x = str2double(inputdlg('number of items purchased:')) % asks for the number of items purchased, and c...
how to create a function, and make the function to take items as its only parameter
The below should do it. x = str2double(inputdlg('number of items purchased:')) % asks for the number of items purchased, and c...
4년 초과 전 | 0
| 수락됨
답변 있음
What is suitable script for the question?
Short answer: script 1. x = linspace(0,pi,100) creates a vector with 100 values in between 0 and pi, so when plotting y and z...
What is suitable script for the question?
Short answer: script 1. x = linspace(0,pi,100) creates a vector with 100 values in between 0 and pi, so when plotting y and z...
4년 초과 전 | 0
답변 있음
How to calculate and store the sum of different column combinations in a matrix?
A similar question has been asked here. Finding out which combination yields the maximum can be done without summing all possib...
How to calculate and store the sum of different column combinations in a matrix?
A similar question has been asked here. Finding out which combination yields the maximum can be done without summing all possib...
4년 초과 전 | 0
| 수락됨
답변 있음
How to find similar indices in two vector
There is probably a better (faster) way than this. But it seems to work. A = randi(1,10000,1); B = zeros(60000,1); %inserti...
How to find similar indices in two vector
There is probably a better (faster) way than this. But it seems to work. A = randi(1,10000,1); B = zeros(60000,1); %inserti...
4년 초과 전 | 0
답변 있음
Setting up and plotting functions
It's rough, but I'm also quite new to Matlab. You answered your own question - you do need to define x, a, b and c. x needs to...
Setting up and plotting functions
It's rough, but I'm also quite new to Matlab. You answered your own question - you do need to define x, a, b and c. x needs to...
4년 초과 전 | 0
| 수락됨
질문
Identifying significantly different pairs from multcompare output
Data attached. Using R2019a I am trying to identify from the 'c' output of multcompare the significantly different pairs (i.e....
4년 초과 전 | 답변 수: 1 | 0