문제를 풀었습니다


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

대략 8년 전

문제를 풀었습니다


Finding Perfect Squares
Given a vector of numbers, return true if one of the numbers is a square of one of the other numbers. Otherwise return false. E...

대략 8년 전

문제를 풀었습니다


Swap the input arguments
Write a two-input, two-output function that swaps its two input arguments. For example: [q,r] = swap(5,10) returns q = ...

대략 8년 전

문제를 풀었습니다


Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example, x=[1 2 3] ----> y = [1.5 2.5] x=[1...

대략 8년 전

문제를 풀었습니다


Bottles of beer
Given an input number representing the number of bottles of beer on the wall, output how many are left if you take one down and ...

대략 8년 전

문제를 풀었습니다


How to find the position of an element in a vector without using the find function
Write a function posX=findPosition(x,y) where x is a vector and y is the number that you are searching for. Examples: fin...

대략 8년 전

답변 있음
Legend title only without marker and lines of data
Looks like the text position is consistently in the upper right (irrespective of range scale values) to me, but if you say you'v...

대략 8년 전 | 0

| 수락됨

답변 있음
How do i make different matrices run through the same code?
If your 2D matrices are of the same dimension they can be combined into a single 3D matrix: D(:,:,1)=matrixA D(:,:,2)=ma...

8년 초과 전 | 0

| 수락됨

문제를 풀었습니다


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...

8년 초과 전

문제를 풀었습니다


Which values occur exactly three times?
Return a list of all values (sorted smallest to largest) that appear exactly three times in the input vector x. So if x = [1 2...

8년 초과 전

답변 있음
Finding how mych values contain a specific number in a matrix
Whilst I can admire the brevity of Walter's code, I might be inclined to use a more 'conventional' alternative A=rand(100...

8년 초과 전 | 0

문제를 풀었습니다


Sort a list of complex numbers based on far they are from the origin.
Given a list of complex numbers z, return a list zSorted such that the numbers that are farthest from the origin (0+0i) appear f...

8년 초과 전

답변 있음
How would i store data into a vector
numElements=10; %Create 1x10 row vector filled with zeros rowVector=zeros(1,numElements) %Create 1x10 column vect...

8년 초과 전 | 0

| 수락됨

답변 있음
Can I change the loop size inside the loop?
For loop conditions are set upon entering the loop and the only form of modification that can be made is to 'break' out of the l...

8년 초과 전 | 0

답변 있음
How can I write log(e) in MATLAB?
I assume you mean log10? In Matlab log is base e, so log(e)=1 x=log10(exp(1))

8년 초과 전 | 2

| 수락됨

답변 있음
"Function definitions are not permitted in this context."
If you have a function in a script (allowed from R2016 onwards I think), it must go at the end, after all the script code

8년 초과 전 | 0

답변 있음
All possible pairs in a vector
nchoosek(A,2)

8년 초과 전 | 1

답변 있음
Matrix indexing - Picking columns
Do you mean this instead of your 1:5:end? 5:5:end If you explicitly also want column 1 the you could use [1 5:5:end]

8년 초과 전 | 1

| 수락됨

답변 있음
How to run the code?
From the overview given by your link, the main function is: function [digest, MSG_PADDED] = image_hash(V_LEN,H_LEN,METH,IMG...

8년 초과 전 | 0

| 수락됨

답변 있음
Function that pulls a name from a list at random but doesn't repeat
listNames={'a','b','c','d','e','f','g','n','h'} for iter=1:9 name=pick_name(listNames) end functio...

8년 초과 전 | 0

| 수락됨

답변 있음
How to find a location of a specific value inside a matrices that is 26x7x101 of length
[~,loc]=ismember(matrixName,value) [i,j,k]=ind2sub([26,7,101],find(loc,1)) The above will find the first specified...

8년 초과 전 | 1

| 수락됨

답변 있음
How do I print the common elements in a row vector?
use the logical vector to index the common values common=A(ismember(A,B)) if you have multiple values in A that are the ...

8년 초과 전 | 0

답변 있음
Check values under a certain threshold with an undefined window
A=[9 10 47 50 49 48 2 46]; mymax=max(A); % in this case mymax=50 mincondition=mymax*0.9; % mincondition=45 indexe...

8년 초과 전 | 0

| 수락됨

답변 있음
How to process a subset of a matrix
matrixName(2,:)=matrixName(2,:)/2

8년 초과 전 | 0

| 수락됨

답변 있음
Re-generate random matrix
ind=randperm(81) B=reshape(A(ind),9,9)

8년 초과 전 | 3

| 수락됨

답변 있음
Replacing values in a table
tab = 10×2 table C1 C2 __ ___________ 1 -32768 2 ...

8년 초과 전 | 1

답변 있음
I have a two column matrix and want to eliminate the rows whose interval contain a certain value
A=[12 44; 56 78; 81 100; 110 200; 210 300;450 500; 600 710] vec_control=[60 115 460] for iter=1:length(vec_contr...

8년 초과 전 | 0

| 수락됨

답변 있음
Helping filling missing data with 0 value
data=importdata('test.txt') fullList=[(1:365)' zeros(365,1)]; partList=data(:,1); isPresent=ismember(fullList,par...

8년 초과 전 | 0

| 수락됨

답변 있음
how do i use the strtok() function in combination with the while loop?
str='Welcome to the coffee shop' newStr=[] while length(str)~=0 [str, remain] = strtok(str) newStr=[ne...

8년 초과 전 | 1

답변 있음
Sum of highest length of consecutive lowest values from a array.
A = [5 1 1 1 6 1 1 1 1 1 1 1 7 1 1 1 7] B=int32(A==min(A)); [startInd lastInd]=regexp(char(B+48),'[1]+'); counts=...

8년 초과 전 | 0

더 보기