Answered
How to convert the contents of a cell array into specific numbers?
Pro_patho_data = {73, 't2b'; 59, 't1c'; 58, 't3b'; 78, 't3b'}; %demo data col1 = cell2mat(Pro_patho_data(:, 1)); col1(...

8 years ago | 2

Answered
how can i decrease the running time of for loop
Without an explanation of what your code is doing it's near impossible to improve it. Particularly as you haven't explained how ...

8 years ago | 0

| accepted

Answered
why below code takes longer time to execute, even with only one input image it takes longer time to execute.
You haven't vectorised any of your code. Try this: function [Fcc,Fcs,Fsc,Fss]=fun_cosine_series2(f,u,v) a = pi * u /...

8 years ago | 0

| accepted

Answered
sorting a matrix to circularly shifted matrix in efficient way
function [sorted, order] = sort_mat(mat) tosort = mat; sorted = zeros(size(mat), 'like', mat); numelems = si...

8 years ago | 1

| accepted

Answered
OOP/Class Questions: deepcopy & AbortSet
1. Deriving from <https://www.mathworks.com/help/matlab/ref/matlab.mixin.copyable-class.html matlab.mixin.copyable> is the easie...

8 years ago | 0

| accepted

Answered
Ignoring keyboard press if several keys are pressed simultaneously?
_Is there a way to circumenvent this other than including a piece of code_ No, but that piece of code is trivial to write. In...

8 years ago | 0

Answered
Find position of when 0 goes to 1
[signal, time] = find(diff(yourarray, [], 2) == 1); Will return two vectors indicating on which rows (signal) and which col...

8 years ago | 1

Answered
high physicial memory usage
Each time you call |spectrofun2| you create a new figure. You never close the figure, so if you're processing 1400 files, you'll...

8 years ago | 2

| accepted

Answered
What does this mean and what could be the possible reasons behind it?
_There is no more red lines_ Well, you didn't show us the _error using * Inner matrix dimensions must agree_ before. That's t...

8 years ago | 1

Answered
while using interp1 following errors found
There is no problem with |interp1|. You have in your code trq_new(j,:) with |j| varying from 1 to 17 But |trq_new| ha...

8 years ago | 1

| accepted

Answered
convert int16 to uint16 without losing information
It's an old thread but since it's been revived: In theory, the following should be faster than transitioning to double as it's j...

8 years ago | 0

Answered
Error Reference to non-existent field
Well, the problem is easy to troubleshoot. For these lines to work: pos = load('data/multiple_fast_hist.mat'); neg = loa...

8 years ago | 0

Answered
How to convert jpeg file to RAW10 data format?
While yes, as Walter says, you potentially could write a converter, it seems to be the opposite workflow to what people normally...

8 years ago | 0

| accepted

Answered
Table array with numerical row names
Convert your numbers to a cell array of *char array* (strings are not supported strangely). If the vector of numbers is all inte...

8 years ago | 0

| accepted

Answered
How can I find and remove the rows starting with different word?
Your english is fine and I understood what you want to do. If the first letter of every line is belong to the character set [...

8 years ago | 0

Answered
Comment out the rest of the code
* ctrl + G * 100, enter * ctrl + shift + end * ctrl + R whether or not it's simpler than %{ ... %} is up to you. ...

8 years ago | 0

Answered
Find the maximum value and its position of a 10x10x10 matrix which meets a set of parameters.
h = 70; c = linspace(30,60,10); b = linspace(1,h-2,10); a = linspace(1,14,10); [A, B, C]=meshgrid(a,b,c); M ...

8 years ago | 0

| accepted

Answered
'Function 'subsindex' is not defined for values of class 'cell'.these error occurs in my code
Presumably, you've copied most of the code from somewhere and added your first line with the |xlsread|. The code you've copie...

8 years ago | 0

| accepted

Answered
Does Otsu is also used for color image segmentation.
The whole principle of Otsu is to work on intensities. So you could apply Otsu to the grayscale intensities, or the red channel ...

8 years ago | 0

| accepted

Answered
Testing the mean of multiple rand(N) variables
%... s=s+x^4/N; For some reason, you're calculating the 4th power of the mean. The mean is indeed 0.5 and 0.5^4 = 0.0625...

8 years ago | 0

Answered
How do I get the dimensions of matrices in cell array?
As a rule, I would never use |length| because it is often used incorrectly (on a matrix). For a vector I'd use |numel|. In my op...

8 years ago | 1

| accepted

Answered
how to implement a moving window with a condition ?
You can either use |conv| (i.e. a convolution) to compute a count of something over a sliding window, or since R2016a, <https://...

8 years ago | 1

Answered
Matrix addition of a first column in a loop
With a loop: colsum = yourcellarray{1}(:, 1); for cidx = 2:numel(yourcellarray) colsum = colsum + yourcellarray{cid...

8 years ago | 0

| accepted

Answered
Index satisfying multiple conditions
I do not really understand what you are trying to do with the |loc(1):max(loc)| bit. As Elias says, you want | instead of &....

8 years ago | 0

| accepted

Answered
Why can't I import multiple files?
|'01.txt'| and |'1.txt'| are two different filename. You ask to load the latter when it's the former that exists. file = s...

8 years ago | 1

Answered
Reading variables from a big matlab Table
Yes, |matfile| won't help since it can't partially load a table. Unfortunately, as you are now there is no workaround I'm awa...

8 years ago | 0

| accepted

Answered
i am unable to zigzag scan image
You cannot copy the body of a *function* into your code and expect it to work like a *script*. The function needs to be in its o...

8 years ago | 0

Answered
In an assignment A(:) = B, the number of elements in A and B must be the same.
I would have thought you'd get an error in the previous loop with your: Code(Smallest_set(o)) = strcat('1',Code(Smallest_set...

8 years ago | 0

Answered
Please your help is needed. I have the following 3-D array and would like to sum the values in second column and the third column based on their index values in frist column.
Since you've got some sort of label attached to the 3 columns of your array, another option to Stephen's answer is to convert th...

8 years ago | 0

| accepted

Answered
Understand the fillmissing function with movmean
The missing elements are in effect calculated with movmean(A, k, 'omitnan') with |k| your windows size. As per the...

8 years ago | 0

| accepted

Load more