Answered
How to convert UTC timehour into IST time hour?
Since IST is simply UTC +5:30, in the absence of date, it's simply: ISTtime = mod(UTCtime + 5.5, 24)

9 years ago | 0

| accepted

Answered
Counting consecutive values in a matrix
No loop needed: diff([0 find(diff(A)) numel(A)])

9 years ago | 3

| accepted

Answered
Problems with indexing in multidimensional array
Well, to see the problem, simply do: clear test; clear test2; test = ones(4,1,1,3,3,4); test2(:, :, :, 1, :, :) ...

9 years ago | 1

| accepted

Answered
xlswrite to multiple new sheets
Looking at your original code, and the code you say fixed your issue, it is clear that you don't understand how cell arrays work...

9 years ago | 0

Answered
how to perform Many to one mapping
Is this what you're after? (I'm unclear on the result you want to obtain) a = randi([0 1], 756, 1); %random demo data b...

9 years ago | 0

Answered
grouping string values in matlab
t = readtable('help.xls', 'Range', 'A3:C17', 'ReadVariableNames', false); t.Properties.VariableNames = {'Person', 'Weekda...

9 years ago | 1

| accepted

Answered
How to compare each element of a matrix with a number?
Simply C >= 1 will give you a logical matrix the same size as C, where logical 1, true, indicates where the correspondin...

9 years ago | 0

Answered
split matrix into matrices with rows in same range
As John says clearer criteria for splitting the rows would be welcome. If all the requirement is that the difference between ...

9 years ago | 1

| accepted

Answered
Hello can somebody help me? I have to find the minimum and the sum of the second diagonal of a matrix 4x4 by creating a function myself.
_"I tried something but it doesn't work"_ It doesn't look like you tried very hard to me. function [maxim]=MAX(A) so,...

9 years ago | 0

Answered
plot graph from array
<https://www.mathworks.com/help/matlab/plot.html |plot|>, <https://www.mathworks.com/help/matlab/surf.html |surf|> or any other ...

9 years ago | 0

Answered
How do we automatically read current folder name in matlab script to read all data?
<https://www.mathworks.com/help/matlab/ref/pwd.html |pwd|> will give you the name of the current directory. It's then trivial to...

9 years ago | 3

| accepted

Answered
How Can I Save Some Fields of a Struct Using uisave Function?
Simply use <https://www.mathworks.com/help/matlab/ref/uiputfile.html |uiputfile|> instead of |uisave| then use the returned path...

9 years ago | 0

Answered
Can't find a string inside a cell array
As others have said, you must be doing something wrong somewhere that you're not showing us. However, since you say that |ism...

9 years ago | 0

Answered
Using the selected string of listdlg not the index number
Well, since you obviously have the |ListString| you passed to |listdlg| in the first place, just use the returned index to retri...

9 years ago | 0

Answered
adding an array with steps untli the last row
newarray = 0.02 * reshape(1:numel(a), size(a)) would work and produce an array/matrix the same shape of A, regardless of th...

9 years ago | 0

Answered
How can i fix this error (newton)?
The error message is fairly clear, there's something wrong in column 33 of line 1. Sure enough, there we find: |'f'| I don't ...

9 years ago | 2

| accepted

Answered
How to retrieval back the color in particular area from original image?
Much simpler: maskedimage = immultiply(colorImage, repmat(mserMask, [1, 1, size(colorImage, 3)])); imshow(maskedimage); ...

9 years ago | 1

| accepted

Answered
How do I store a series of RGB images in a 2D array?
You can indeed use a 2D cell array where each cell is one of the 3D matrix tile. This may be the simplest thing for you. You cou...

9 years ago | 1

| accepted

Answered
Adding effects to imported pictures
Let's start with the problems with your code max = max(size(img)); I don't know where you got the idea to name a variabl...

9 years ago | 0

Answered
How to exchange all values of a row to zero, if this row contains one or more NaNs?
yourmatrix(any(isnan(yourmatrix), 2), :) = 0

9 years ago | 0

| accepted

Answered
Finding and counting numbers from one matrix in another
Another method of obtaining the result, which works regardless of the values of the node ids, and whether or not a node is prese...

9 years ago | 1

Answered
Problem with getting a reasonable plot for mixed positive and negative data result
You've got such a huge spike for alpha = 0.5 at around theta = -30 that your plot just looks like a line on the default [min max...

9 years ago | 0

Answered
help! my variable entry is not displaying as entered.
First to answer your question, in the line before last of your script |D| is _very clearly defined as_ the max of V, overwriting...

9 years ago | 1

| accepted

Answered
Primary key issue in insert a table into SQlServer database
I'm not sure what is not clear about the error. As it says, you're trying to add a row whose value for the primary key already e...

9 years ago | 0

| accepted

Answered
difference between in2int16 and int16
As per the documentation of |im2int16|, it rescales the data as necessary, meaning that if the orginal values are not already in...

9 years ago | 1

Answered
How can I get a random value in a matrix, given a probability of each value being chosen?
Note that your probabilities should sum up to 1. Otherwise, they're not probabilities. So you need to divide them by the sum of ...

9 years ago | 0

| accepted

Answered
Can anyone help me in this code ?
I strongly suspect that you want the number of query points in, on and outside the polygon, which you'll never get with |numel| ...

9 years ago | 0

| accepted

Answered
Crosstab with Sum instead of count
You probably can use the newish <https://www.mathworks.com/help/matlab/ref/findgroups.html |findgroups|> and <https://www.mathwo...

9 years ago | 0

| accepted

Answered
use of find command for 3d array
For arrays with more than two dimensions you have to get the linear index (1 output version of |find|) and then transform that i...

9 years ago | 1

| accepted

Answered
Select from 2D Array by 2 criteria - Matlab
filteredarray = yourarray(yourarray(:, 2) > 0.9 & yourarray(:, 2) <= 1.2, :); %filter unwanted rows [~, maxrow] = max(filt...

9 years ago | 1

Load more