문제를 풀었습니다


Guess Cipher
Guess the formula to transform strings as follows: 'Hello World!' --> 'Ifmmp Xpsme!' 'Can I help you?' --> 'Dbo J ifmq zpv...

13년 초과 전

문제를 풀었습니다


Make a diamond
Given n, odd number > 1, return n by n matrix consist of "null" and "*" characters arranged like a diamond. No toolbox funct...

13년 초과 전

답변 있음
adding every element of an array with every element of another array?
Pranav wrote: "...i want to add elemnts of A to be added to every other elemnet of B. ie. 1+[5 6 7 8],2+[5 6 7 8],...so on..." ...

13년 초과 전 | 1

| 수락됨

답변 있음
finding the mean for large data
A = rand(3,192); n = 9; s = size(A); out = squeeze(nanmean(reshape([A nan(s(1),mod(-s(2),n))],s(1),n,[]),2)); ...

13년 초과 전 | 0

답변 있음
Matrix and vector multiplication elementwise
Rica wrote: "...how to calculate: ... C=[a(1,1)*h(1) a(1,1)*h(2) a(1,1)*h(3); a(2,1)*h(1) a(2,1)*h(2) a(2,2);.......;...;a(...

13년 초과 전 | 0

답변 있음
Write MatLab commands to find the index of the max value in the bold area of A
variant B = -inf(size(A)); B(1:8,3:5) = A(1:8,3:5); [m,n] = find(abs(B - max(B(:))) < eps(100));

13년 초과 전 | 0

답변 있음
Edit:Value Exceeeds while dividing
[~,i1] = sort(A); B1 = sort(B); [~,i2] = sort(i1); C = B1(i2);

13년 초과 전 | 0

| 수락됨

답변 있음
please give correction in code
last 6 rows: r = unique(data); z = nan(numel(r),2); for i1 = 1:numel(r) c = data(data(:,1)==r(i1),2); z...

13년 초과 전 | 0

답변 있음
if i have a for loop doing iterations based on random intervals of time between .5-5 seconds, how do i keep track of that time?
x = cumsum(.5+4.5*rand(60,1)); or just x = sum(.5+4.5*rand(60,1));

13년 초과 전 | 1

| 수락됨

문제를 풀었습니다


Detect a number and replace with two NaN's
Write code which replaces the number 1 with two NaNs. Example X = [ 1 2 NaN 4 1 3 7 NaN 1 4 NaN 2] ...

13년 초과 전

문제를 풀었습니다


What's Your BMI?
Find the body mass index. For reference, please refer to Wikipedia here: <http://en.wikipedia.org/wiki/Body_mass_index body ...

13년 초과 전

문제를 풀었습니다


Make a 1 hot vector
Make a vector of length _N_ that consists of all zeros except at index _k_, where it has the value 1. Example: Input ...

13년 초과 전

답변 있음
how to replace the values of one matrix to another
f=[ 1 2 5 6 3 4 7 8 9 10 13 14 11 12 15 16] c=[1;1]*(1:8); f2 = permute(reshape(f,[2 2 2 2]),[3 1 4 ...

13년 초과 전 | 0

답변 있음
Removing repeating data points
A = randi(10,3) B = randi(10,5) A(ismember(A(:),B(:))) = nan

13년 초과 전 | 1

답변 있음
Set logical array values to true if value n values ahead is true
x = [0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0] > 0; n = 2; x(bsxfun(@minus,find(x),(n:-1:1)')) = true;

13년 초과 전 | 0

| 수락됨

문제를 풀었습니다


Given a matrix, return the last eigen value
Given a matrix, return the first eigen value For example: x = magic(5) 17 24 1 8 15 23 5 7 14 ...

13년 초과 전

답변 있음
i need to convert a string to a num without using the "str2num" function but in the final answer i have some undesired spaces. how can i remove them?
out = (st-'0')*10.^(numel(st)-1:-1:0)'; or from Cody out = polyval(st-'0',10);

13년 초과 전 | 0

문제를 풀었습니다


Exact binary matrix factorization
Given a binary-valued (only ones and zeroes) MxN matrix C, and K (where K<M and K<N) find a binary-valued MxK matrix A and a bin...

13년 초과 전

문제를 풀었습니다


Subtract two positive numbers
Given a and b as a string, return b-a without using string to number conversion functions. a and b must to be a same size and b ...

13년 초과 전

문제를 풀었습니다


Create a Multiplication table matrix...
Create a product table in this format: P = [ 1 2 3 4 5; 2 4 6 8 10; 3 6 9 12 15; 4 8 12 1...

13년 초과 전

답변 있음
Finding the position of valaue
[out,out] = ismember(B,A);

13년 초과 전 | 0

문제를 풀었습니다


Basics: 'Find the eigenvalues of given matrix
Find the eigenvalues y for a given matrix x.

13년 초과 전

답변 있음
All possible combinations of 2 vectors.
variant t = [1 3 5]; ii = perms([t, zeros(size(t))]); out = unique(sort(t(:,1:numel(t)),2),'rows'); or t = [1...

거의 14년 전 | 1

문제를 풀었습니다


Unique values without using UNIQUE function
You must return unique values in a vector in *stable* mode without using the unique function. About stable order flag: ...

거의 14년 전

문제를 풀었습니다


Divisors of an integer
Given a number N, return a vector V of all integers that divide N. For example, N = 10 Then V=[1 2 5 10]

거의 14년 전

답변 있음
log function for symbol with power
evalin(symengine,'log(a,a^15)') feval(symengine,'log',a,a^15)

거의 14년 전 | 0

답변 있음
Edit:Replacing 5 bits in Binary value
A=[1056;1078] B=[31;25]; C = decbin(A,11); D = dec2bin(B,4); n = 4; C(:,n : n + size(D,2) - 1) = D

거의 14년 전 | 0

| 수락됨

문제를 풀었습니다


Solving a quadratic equation
Given a, b ​​and c, Return the solution of the following quadratic equation: a*x^2 + b*x + c = 0.

거의 14년 전

문제를 풀었습니다


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

거의 14년 전

더 보기