Community Profile # Antonio Aguirre

Last seen: 5 meses ago Active since 2016

#### Statistics

All
• • • • #### Content Feed

View by

Solved

Find the Best Hotels
Given three input variables: * |hotels| - a list of hotel names * |ratings| - their ratings in a city * |cutoff| - the rat...

5 meses ago

Solved

Crop an Image
A grayscale image is represented as a matrix in MATLAB. Each matrix element represents a pixel in the image. An element value re...

5 meses ago

Solved

Calculate BMI
Given a matrix |hw| (height and weight) with two columns, calculate BMI using these formulas: * 1 kilogram = 2.2 pounds * 1 ...

5 meses ago

Solved

Plot Damped Sinusoid
Given two vectors |t| and |y|, make a plot containing a blue ( |b| ) dashed ( |--| ) line of |y| versus |t|. Mark the minimum...

5 meses ago

Solved

Calculate a Damped Sinusoid
The equation of a damped sinusoid can be written as |y = A.&#8519;^(-&lambda;t)*cos(2πft)| where |A|, |&lambda;|, and |f| ...

5 meses ago

Solved

Solve a System of Linear Equations
Example: If a system of linear equations in x₁ and x₂ is: 2x₁ + x₂ = 2 x₁ - 4 x₂ = 3 Then the coefficient matrix (A) is: 2 ...

5 meses ago

Solved

Verify Law of Large Numbers
If a large number of fair N-sided dice are rolled, the average of the simulated rolls is likely to be close to the mean of 1,2,....

5 meses ago

Solved

Find the Oldest Person in a Room
Given two input vectors: * |name| - user last names * |age| - corresponding age of the person Return the name of the ol...

5 meses ago

Solved

Convert from Fahrenheit to Celsius
Given an input vector |F| containing temperature values in Fahrenheit, return an output vector |C| that contains the values in C...

5 meses ago

Solved

Calculate Amount of Cake Frosting
Given two input variables |r| and |h|, which stand for the radius and height of a cake, calculate the surface area of the cake y...

5 meses ago

I want to plot a graph like this in Matlab. It would be a great help if someone can help me with the same by providing the code.
Hi, So I tried the following below. Minus the LaTeX formatting, I think it's exactly what you need. Also, the function that you...

alrededor de 2 años ago | 0

| accepted

simulate a random walk in 1D which can move both in x and -x direction and plot it using normal distribution with standard deviation1 and mean 0
To generate a single random number from a normal distribution you can excute the following code: % Where r is a random number f...

alrededor de 2 años ago | 0

| accepted

Solved

Check if sorted
Check if sorted. Example: Input x = [1 2 0] Output y is 0

más de 3 años ago

Solved

Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

más de 3 años ago

Solved

Put two time series onto the same time basis
Use interpolation to align two time series onto the same time vector. This is a problem that comes up in <http://www.mathwork...

casi 5 años ago

Solved

"Low : High - Low : High - Turn around " -- Create a subindices vector
Let two vectors *lo* and *hi* be given. The job is to create a index vector like so idx = [lo(1):hi(1) lo(2):hi(2) ...]...

casi 5 años ago

Solved

Return unique values without sorting
If the input vector A is [42 1 1], the output value B must be the unique values [42 1] The *values of B are in the s...

casi 5 años ago

Solved

Specific Element Count
Given a vector _v_ and a element _e_, return the number of occurrences of _e_ in _v_. Note: NaNs are equal and there may be n...

casi 5 años ago

Solved

First non-zero element in each column
For a given matrix, calculate the index of the first non-zero element in each column. Assuming a column with all elements zero ...

casi 5 años ago

Solved

Getting logical indexes
This is a basic MATLAB operation. It is for instructional purposes. --- Logical indexing works like this. thresh = 4...

casi 5 años ago

Solved

Replicate elements in vectors
Replicate each element of a row vector (with NaN) a constant number of times. Examples n=2, A=[1 2 3] -> [1 1 2 2 3 3] ...

casi 5 años ago

Solved

Set the array elements whose value is 13 to 0
Input A either an array or a vector (which can be empty) Output B will be the same size as A . All elements of A equal to 13...

casi 5 años ago

Solved

Find the largest value in the 3D matrix
Given a 3D matrix A, find the largest value. Example >> A = 1:9; >> A = reshape(A,[3 1 3]); >> islargest(A) a...

casi 5 años ago

Solved

Check if number exists in vector
Return 1 if number _a_ exists in vector _b_ otherwise return 0. a = 3; b = [1,2,4]; Returns 0. a = 3; b = [1,...

más de 5 años ago

can anyone help me ...Write a MATLAB m-file function (dice.m) which simulates one or more dice with each die giving values from 1 to 6
function [prob varargout] = diceSim(numDice) % Generates random numbers from 1 to 6 % Store them in a matrix...

casi 6 años ago | 0

how can a script that reads a number of strings from standard input and prints them in reverse order be written ?
Try the function fliplr(); If: A = {'t','d','f'}; A = fliplr(A) ans = 1×3 cell array 'f' 'd' 't'

casi 6 años ago | 2

Question

How can I generate C++ code for a user defined MATLAB class
I need to export a user-defined MATLAB class to C++. I need the class to have multiple instances in the C++ environment. I un...

casi 6 años ago | 1 answer | 0

### 1

Solved

Remove any row in which a NaN appears
Given the matrix A, return B in which all the rows that have one or more <http://www.mathworks.com/help/techdoc/ref/nan.html NaN...

casi 6 años ago

Solved

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

casi 6 años ago

Solved

Weighted average
Given two lists of numbers, determine the weighted average. Example [1 2 3] and [10 15 20] should result in 33.333...

casi 6 años ago