Answered
Why am I getting error asIllegal use of reserved keyword ''end"
Probably because you have an end without a starting if. Even ignoring that line 1 and 4 should be a comment, I'm afraid to say y...

6 years ago | 0

| accepted

Answered
Convert string array to datetime
Yes, there's no 'T' in your input so the format should be 'yyyy-MM-dd HH:mm:ss.SSSSSSSSSXXX' >> s = "2016-07-22 10:02:54.087216...

6 years ago | 1

| accepted

Answered
How to extract submatrix from the Main matrix???
If you have the image processing toolbox: subnatrices = struct2cell(regionprops(logical(Z), 'Image'))

6 years ago | 0

| accepted

Answered
How to compare array's values with each other?
It's unclear how you get your error if your i and j were just created with a for i = 1:m and for j=1:m. They're clearly somethin...

6 years ago | 1

| accepted

Answered
Transform cells to matrix
Assuming that the x, y and z are indeed integer as in your example, from 0 to Nx, Ny, Nz, then the easiest way may be: result =...

6 years ago | 0

Answered
Return all possible Cuts of array A If you have defined number of parts M
"empty partitions are allowed" I assume you mean not allowed, otherwise your solution is missing two cuts. %V: a row vector to...

6 years ago | 0

| accepted

Answered
Can MATLAB convert text file to RPC III format ?
If you're talking about this format: https://www.mts.com/cs/groups/public/documents/library/mts_007569.pdf, then I don't see how...

6 years ago | 0

| accepted

Answered
How can i set the color of segmented image staticly in matlab ?
You can pass your own colour map to label2rgb but I don't think that's what you're asking. label2rgb assign colours to objects ...

6 years ago | 0

Answered
Extract data from a cell array/struct
What I want to do is to extract the third column of the data field from each struct within the cell array and complile it into a...

6 years ago | 1

| accepted

Answered
cell to matrix conversion with a slight modification
Assuming that you mean a 501x16 matrix, then: m = reshape(cat(3, yourcellarray{:}), [], numel(yourcellarray)).' This concatena...

6 years ago | 1

| accepted

Answered
Index in position 2 exceeds array bounds (must not exceed 1)
a) get rid of all the unnecessary brackets that make it harder to read your expressions x = [indexbase(1,1), indexknuckle1(1,1)...

6 years ago | 0

| accepted

Answered
question about vectorization using indexes
Another option is to append a 0 (or any finite value) to the start of a and increase ind by 1, so a(ind+1) is always valid. Assu...

6 years ago | 0

Answered
Sending data via udp. Would appreciate help with the proper way of converting a cell array containing char, string, double to ASCII data
strData = string(DATA); for row 1:size(strDATA, 1) strrow = strjoin(strDATA(row, :), '\t') + char(10); fwrite(updMoni...

6 years ago | 1

| accepted

Answered
Fill table of NaNs with data though loop
It's not clear what you're doing in the loop. Possibly, you should be using rowfun, groupsummary or similar instead of an explic...

6 years ago | 0

| accepted

Answered
Finding exact rank of a matrix element
look up the elements of vector B in column 2 of A to get the corresponding values in column 1 of A. But A and B are dismilar in ...

6 years ago | 0

| accepted

Answered
Summin elements on the rows of a specific page of a matrix
B = sum(A(:, :, 1), 2); %sum 1st page of A across the columns (across the 2nd dimension)

6 years ago | 1

| accepted

Answered
Copy part of an RGB image to another
I really don't understand why you went with this very roundabout code, very little of it makes any sense: e.g: idx = zeros(siz...

6 years ago | 0

| accepted

Answered
How to do one hot encoding of unusual letters in matlab?
file containing the characters that I want to one hot encode. Do you know how I can go about now %phoneme_set: A cell array of ...

6 years ago | 0

Answered
add jpeg toolbox in matlab 2014a
I know nothing about that toolbox but all these missing symbols looks like symbols from libjpeg. I assume it's a dependency of t...

6 years ago | 0

Answered
stlwrite error: Tetrahedron triangulation is not supported.
A 3D alphashape is a volume, therefore its triangulation is made of tetrahedrons not triangles. stlwrite only supports triangula...

6 years ago | 4

| accepted

Answered
how to interpolate a value from an excel file depending on an input and then assign the result to a variable.
In modern matlab, I'd recommend you use readtable instead of xlsread, particularly if your excel file has column headers since t...

6 years ago | 0

| accepted

Answered
What is wrong with this code?
Well, we can tell you what could be wrong with your code, but since you've given us absolutely no information about what it's me...

6 years ago | 2

Answered
How to calculate sum of pixel values in grey scale images.
Not many details are given, but shouldn't it be: sum(myROI(:)) %sum of all values in array myROI If on R2018b or later, you c...

6 years ago | 0

| accepted

Answered
Could anyone help me to solve the issue in the following code.
What I actually need is the ouput should be as follows: [ 0 0.2948 0 0 0.2310; 0 ...

6 years ago | 0

Answered
I have a 4 nested for loops which I am not able to vectorize.
Ok, so you effectively have 6 dimensions here, the ii, jj, i, j, the f and debut, so we're going to have to work in 6D. Working ...

6 years ago | 0

Answered
Create a list of images from subfolders with specific names using dir , strcat!
Very confusing code and confusing question. But It just gives the last years. Well, yes of course, in the loop you overwrite l...

6 years ago | 0

| accepted

Answered
Histogram using Date Stamps
Oh, if it's the histogram of the dates you want, then groupsummary may not be the best tool (sorry Adam!) histogram(yourdatetim...

6 years ago | 1

| accepted

Answered
How to create a matrix that has zero in middle?
The line x(size(n)-A:end-1,size(n)-A:end-1)=0; is full of bugs. First, what is the output of size(n)? It's guaranteed to be a...

6 years ago | 0

| accepted

Answered
"how to create a matrix of coordinates and how to calculate the distance b/w different coordinates of the same matrix w.r.t the any single coordinate element?"
It's not clear where your X and Y come from and it's also not clear how you want the points to be stored since you don't use val...

6 years ago | 0

Answered
Delete rows with bad data and surrounding rows
First, the easiest and fastest way to implement criterion 1 is: todelete = any(B, 2); For criterion 2, since you just want to ...

6 years ago | 1

Load more