Solved


Find the area of a triangle
Given a triangle with a base b and height h, return the triangle area.

11 years ago

Solved


Spherical Volume
Calculate the volume of a sphere.

11 years ago

Solved


Convert from integer to binary
if true % decimalToBinaryVector(x) end

11 years ago

Solved


Average Grade
Given a 1x5 vector presents the grades of a student on five tests. Calculate the average grade of that student.

11 years ago

Solved


Multiply by 3 and subtract 1
As a class assignment, I'm making a Cody problem. It shouldn't be terribly difficult. Given the variable x as your input, mu...

11 years ago

Solved


Fun with a compass
Each night for the past week, you have been having the same nightmare: You find yourself back in your junior high school geometr...

11 years ago

Answered
How to handle different versions of functions within one project?
This is a problem in any language not just matlab. The common way to resolve this issue in a lot of languages is to use namespac...

11 years ago | 1

| accepted

Answered
finding the maximum value table A for values in table B bellow benchmark
One possible way, assuming that values in |A| are always positive: AA = repmat(A', 1, numel(C)); D = max(AA .* bsxfun(@l...

11 years ago | 0

| accepted

Answered
how to bin data based on two variables to create a joint occurance table?
If you have matlab 2015b, you can simply use <http://www.mathworks.com/help/releases/R2015b/matlab/ref/histcounts2.html |histcou...

11 years ago | 2

| accepted

Answered
Ho to copy an object (deep copy) which has inside another object
As per <http://www.mathworks.com/help/releases/R2015b/matlab/ref/matlab.mixin.copyable-class.html its documentation> |matlab.mix...

11 years ago | 3

| accepted

Answered
Converting yyyymmdd double to decimal year
An alternative to the conversion to string and back, which is always going to be slow, is to divide and mod you date variable: ...

11 years ago | 1

| accepted

Answered
Subscript indices must either be real positive integers or logicals.
In the code you've posted, the only parts that matlab could interpret as subscripting a variable are the function calls to |lins...

11 years ago | 0

Answered
Running .vbs file from MATLAB
Possibly: system(sprintf('cscript.exe "%s"', 'c:\full\path\to\your\script'); Considering that vbs scripts tend to just c...

11 years ago | 3

| accepted

Answered
triangle matrix with different number of columns
Use <http://www.mathworks.com/help/releases/R2015b/matlab/ref/triu.html |triu|> (or <http://www.mathworks.com/help/releases/R201...

11 years ago | 1

| accepted

Answered
How to convert row*col data into series of column in matlab ?
Your conversion only makes sense if your matrix is sparse (has a lot of zeros), otherwise your converted matrix is going to use ...

11 years ago | 2

Answered
How do I efficiently create a matrix that combines specific columns from pairs of odd and even rows into one, while excluding all columns with NaN values?
It's actually extremely easy: # reshape the pair rows into a two column matrix # remove the rows with nan # <http://www.mat...

11 years ago | 1

| accepted

Answered
How to find the exact location of a word in a string?
Another option, since the words you're trying to match are always delimited by spaces or the end of the sentence (other punctuat...

11 years ago | 2

Answered
unable to execute curl -s http: on windows
With regards to your new error message, it looks very clear to me. Your |mp3info| program cannot find the mp3 file. The fix ...

11 years ago | 0

Answered
How do you add every row of a matrix to every other row to get separate new matix for each addition ?
The <https://en.wikipedia.org/wiki/Cartesian_product cartesian product> of two sets of number can be obtained easily with matlab...

11 years ago | 1

Answered
class method overloading question
The subclass automatically inherits all public and protected (but not private) methods of the baseclass. So, yes, as long as |ru...

11 years ago | 0

Answered
what is the fastest way to search a huge matrix
I'm assuming that the (x, y) pair is always present and only present once in (A, B). Otherwise the code you've posted would fail...

11 years ago | 0

| accepted

Answered
how to convelute two jpg images
Use <http://www.mathworks.com/help/releases/R2015b/matlab/ref/conv2.html |conv2|>. What exactly is the difficulty?

11 years ago | 0

Answered
Remove duplicate elements in an Array based on one of the columns
Here is one way to do it: A =[1 2 3 4; 1 2 4 6; 3 5 7 2; 3 5 4 5; 3 5 3 7;] [~, ~, rows] = unique(...

11 years ago | 4

| accepted

Answered
Problem writing text to file with fprintf
Have you checked that the file you're trying to modify actually has write permissions, and is not read only? Does |fileattrib...

11 years ago | 0

Answered
Function in for loop
Use <http://www.mathworks.com/help/releases/R2015b/matlab/ref/sprintf.html |sprintf|>: for fileidx = 1:150 filename =...

11 years ago | 0

| accepted

Answered
how to return an output with more than one column/row
Just add |'OutputFormat', 'cell'| to your |rowfun| call and it will work. If you want to convert the output cell array to a tabl...

11 years ago | 0

| accepted

Answered
plot 2D array using imagesc ?
The |x| and |y| arguments of |imagesc| only specify the coordinates of two corners of the image, not the intermediate tick marks...

11 years ago | 0

Answered
Looping Error: subscript indices must either be real positive integers or logicals
For a start |x| does not vary in the loop, so you'd be storing the result of the loop always in the same element of |cossum|. Se...

11 years ago | 0

Answered
Error : "Assignment has more non-singleton rhs dimensions than non-singleton subscripts"
From the name, I'd guess that |dec2vec| returns a vector. |a(x, y, z)| is a scalar. You can't obviously squeeze a vector into a ...

11 years ago | 0

Answered
Is the MATLAB COM Automation Server thread safe?
Generally speaking, COM is responsible for managing communication between threads. If your program is multithreaded and you're t...

11 years ago | 1

Load more