Answered
adding index to matrix rows
Please use the code format button *{}Code* rather than putting spaces between each line. A matrix can only contain numbers, c...

10 years ago | 0

| accepted

Answered
why x and y coordinates are not consistent with the axis of the image??
[x,y]=find(b==0) _"why x and y coordinates are not consistent with the axis of the image"_. That is because <http://www.mat...

10 years ago | 0

| accepted

Answered
How to create a Matrice from a structure
_"...and it works well."_ and is also overly complicated: meanintensity = [meanValues.meanIntensity]; will be a lot fast...

10 years ago | 2

Answered
How do I shorten this code to remove one piece of information from each submatrix?
Since all your 2D matrices are the same size you might as well all store them as pages of a 3D matrix. This would make your prob...

10 years ago | 1

| accepted

Answered
Trying to convert a .mat file into .wav file
In matlab, strings are enclosed in single quote. If you don't enclose |C.wav| in quotes then matlab interprets it at the field w...

10 years ago | 0

Answered
extract N maximum values from a vector, with also the relative index position
<http://www.mathworks.com/help/matlab/ref/sort.html |sort|> your vector in descending order. The first 5 values are the top 5 ma...

10 years ago | 1

| accepted

Answered
How to make moving average filter in an array with window size 100 and 50 overlapped elements?
Type 1: |reshape| into rows of 100 hundred elements and average. This should be a lot faster than |arrayfun|: out1 = mean(r...

10 years ago | 0

Answered
How would I find where the median value of a matrix occurs?
By definition, the median is the middle of the sorted values (or the mean of the two middle sorted values if there is an even nu...

10 years ago | 0

| accepted

Answered
How to do foward right division?
The |/| operator ( <http://www.mathworks.com/help/matlab/ref/mrdivide.html |mrdivide|>) is particular to matlab. It solves a <ht...

10 years ago | 0

| accepted

Answered
How to ensure only first image is used in a function???
You simply put a condition in your loop so that it only asks for the roi on the first iteration: %... get list of files any...

10 years ago | 0

Answered
classdef matlab constructor, how does it work?
It's not clear from your post where the class definition ends and where the calling code (obviously in a different file) starts,...

10 years ago | 0

Answered
Not enough input arguments.!!!!
The problem is with the way you call the function, not with the code of the function. You need to pass two arguments to the func...

10 years ago | 0

Answered
Turn TLE time to Julian Days
Unfortunately, the format for the fractional time is not supported by any of the import format of |datetime| or |datenum|, so yo...

10 years ago | 2

| accepted

Answered
match structures by table
Probably the simplest way is to create a function with two inputs, the two field names. Your function then perform the calculati...

10 years ago | 1

Answered
How to take first three characters of string
Azzi's answer with to regex call seems unnecessarily complicated to me. The |cellfun| is also not required. This simple regex wi...

10 years ago | 2

Answered
I want to print the value of t when value of vc1 is 90.5931 but I am not able to do so. please help
As per Dr Siva's answer, do not use |==| to compare floating points numbers unless the two numbers have been obtained exactly th...

10 years ago | 1

Answered
How can I generate a Matrix of specific rows and columns using loop?
It's really not clear what sort of matrix you want to create from your vector. Maybe you just want to <http://www.mathworks.com/...

10 years ago | 0

| accepted

Answered
Loading mat file error
The first error is matlab not being able to load the file for some reason. Maybe it is corrupted, maybe you're using an old vers...

10 years ago | 0

Answered
how to convert matrix to graysclae image?
_" but it doesn't work"_. In what way? What you've showed will display the image, possibly not the way you want, but it will ...

10 years ago | 0

| accepted

Answered
what is the mistake,
_"unfortunately it applys only for (3x3)."_ The code you've posted applies to any size of matrix. There's is nothing restricting...

10 years ago | 0

Answered
calculer le barycentre d'une région avec plusieurs pixel de valeur différente
The barycentre is simply the mean of the point coordinates weighted by their intensity thus: [i, j] = barycentre(i, j, v) ...

10 years ago | 1

| accepted

Answered
Compare a string to all values in column and extract rows where such Strings are found
tf=strcmp('NYCdata_extract(x,2)','Bank'); compares the *string* |'NYCdata_extract(x,2)'| to the string |'Bank'|, *not* the...

10 years ago | 0

Answered
Dear how to change presentation of significan digits in number? I have to solve this problem:
Given the constraints (or lack thereof) of the problem, one would assume you've learned about the range of built-in types. Have ...

10 years ago | 0

| accepted

Answered
changing the dimension representation
First, a piece of advice, use variable names that have meaning, preferably full words. It's impossible to tell from their name a...

10 years ago | 1

| accepted

Answered
Locate an element in an array
From your example. it looks like you want to keep the rows where the elements are found, not remove. Anyway, to find which set o...

10 years ago | 0

Answered
Need help in matrix dimension while converting from fortran to matlab
I know nothing about fortran but it looks to me that your matlab code is not equivalent at all. I would have thought the transla...

10 years ago | 0

Answered
pick one value per munite
To start with, I would convert the datestr array to <http://www.mathworks.com/help/matlab/ref/datetime.html |datetime|> and just...

10 years ago | 0

| accepted

Answered
How to access streaming data and store it?
The equivalent would probably be: queryoptions = weboptions('KeyName', 'Authorization', ... 'KeyVa...

10 years ago | 0

| accepted

Answered
adding rows to array with order
Note: this only works if all the elements of |fixed_data| are unique and only found once in |data| and if |numel(fixed_data) + n...

10 years ago | 0

| accepted

Answered
Create an array containing the values of a cell type matrix corresponding to each of the examples contained in other cell type matrix.
The code you've posted is equivalent to: [numA, ~, A] = xlsread('Data.xlsx',1); [numB, ~, B] = xlsread('Data.xlsx',2); ...

10 years ago | 1

| accepted

Load more