Gelöst


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]; and ...

mehr als 6 Jahre vor

Gelöst


Free passes for everyone!
THIS PROBLEM IS TEMPORALLY DECOMMISSIONED WHILE IT IS UPDATED. PLEASE WAIT _Simply return the name of the coolest numerical c...

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

mehr als 6 Jahre vor

Gelöst


Add two numbers
Given a and b, return the sum a+b in c.

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Gelöst


sum all digits
input = 123456789, output = 1+2+3+4+5+6+7+8+9 = 45

mehr als 6 Jahre vor

Gelöst


Is my wife right?
Regardless of input, output the string 'yes'.

mehr als 6 Jahre vor

Gelöst


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

mehr als 6 Jahre vor

Beantwortet
For loop question of Iteration
Hello, KACPER PAWLOWSKI. You can see the values in each iteration. After each iteration, you must press enter to continue to nex...

mehr als 6 Jahre vor | 0

Beantwortet
Plot Matrix Columns in a Loop
Hello, Jacqueline Kpognon. Do you want to differents figures? Try this: pos = find(y==1); neg = find(y==0); plo...

mehr als 6 Jahre vor | 0

Beantwortet
Question about initial movement of inverted pendulum
Maybe the force is not being applied in the gravity center. So a momentum will be generate, rotating the body. Some parts of th...

mehr als 6 Jahre vor | 0

Beantwortet
How to convert binary number to decimal integer?
Hello. Maybe this can be helpfull for you <https://www.mathworks.com/matlabcentral/answers/98649-how-can-i-convert-a-negat...

mehr als 6 Jahre vor | 0

Beantwortet
I am trying to plot a Gaussian normal probability density function with 500 points, mean=1.5 standard deviation 0.5. The Below is my code. My code doesn't have a error but the plot is not accurate.
Hello Sam. I used: Y = normpdf(x,m,s) and give the same result. Seems that is correct.

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Replacing Values of a Larger Matrix with that of a Smaller Matrix
imgSiz = [x1,y1]; blkSiz = [x1,size_column]; numRep = imgSiz./blkSiz; basMat = toeplitz(mod(0:numRep(1)-1,2),mod(0:nu...

mehr als 6 Jahre vor | 0

Beantwortet
How to Create Alternating Black Columns Across an Image?
Hello Richard! You can try this: size_of_column = 16; img = imread('image_exemple.jpg'); imshow(img); mask = ze...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How to do a convolution for n samples starting from n=0 ?
Hello Jucimar. You can try this: x = [-1 0 1]; h = [0.5 0.25 0 0.125]; w = conv(x,h) w = Columns 1 through...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How to plot a circle of some radius on a polar plot, when the circle is not centered in the origen?
Hello Gabriel Malagon Carvajal. You can try this: %k is a constant that you can difine as the circles size k = 0.4 %a ...

mehr als 6 Jahre vor | 0

Beantwortet
How to crop square of size 100 X 100 around the centroid of an image?
Change x_cent and y_cent for your centroids; change the name of images variables x_cent = 120; y_cent = 150; ...

mehr als 6 Jahre vor | 2

| akzeptiert

Beantwortet
Approximating Pi using a series
PI=0; N=10; %qty of elements in the serie v=zeros(N+1,1); for n=0:N PI=PI+4*(((-1)^n)/(2*n+1)); v(n+...

mehr als 6 Jahre vor | 1

Beantwortet
How to create a vector from two or three point?
A = [1,2] B = [6,3] C = [1,5] AB = B - A AC = C - A The same with three points

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How to change element in base 10 to base 2 in a matrix, with loops and while
A = magic(5) %generating a matrix 5x5 A = (A<10) %suppose you want the elements in A < 10

mehr als 6 Jahre vor | 0

Beantwortet
how do i approximate pi using queation of arctan(1)=4*arctan(1/5)-arctan(1/239) ?
This may be helpfull: <https://br.answers.yahoo.com/question/index?qid=20090809111721AA7YUFZ>

mehr als 6 Jahre vor | 0

Beantwortet
How to find the gradient of a curve at a specific point?
If the data is in the variable "data", you find the gradient like this: grad = zeros(size(data)) for i=1:(size(dat...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
Matlab code to find hand extremeties and centre of a hand after image segmentation.
Hello Manjiree Waikar. Have you tried this:? <https://www.mathworks.com/matlabcentral/fileexchange/46573-roi-of-palmprint-...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
From a structure find the number of rows with a certain character
Hello Asim Ismail! Maybe this can be helpfull: I create a struct "s" with a field "type". clear all; close all; ...

mehr als 6 Jahre vor | 0

| akzeptiert

Beantwortet
How to add dates to a read loop
It appears you need to concatenate tables; see for example <https://www.mathworks.com/matlabcentral/answers/233921-how-to-ad...

mehr als 6 Jahre vor | 0

Mehr laden