Answered
Can imtranslate and squeeze be combined to one code line?
As long as you only need the first output of each function, you can chain as many functions as you want regardless of what they ...

8 years ago | 3

Answered
Why do I get an error from using actxserver('PowerPoint.Application')?
_Invalid ProgID 'PowerPoint.Application'_ This would indicate that powerpoint is not installed properly. I think it would ...

8 years ago | 0

Answered
Comparing two matrices to find common elements
Simply use <https://www.mathworks.com/help/matlab/ref/ismember.html |ismember|>: [rowisinlarger, where] = ismember(smallerm...

8 years ago | 0

| accepted

Answered
how to improve the efficiency of this code part?
Assuming that |x| and |yn| are *row* vectors, and assuming R2016b or later for implicit expansion: indices = (1:Nw) + (1:nu...

8 years ago | 0

Answered
2D convolution in in Matlab.
_What could be the possible reason? And, how can I obtain the expected output?_ |imshow| expects that that intensity of a do...

8 years ago | 0

| accepted

Answered
How to display a matrix whose elements are strings?
Not entirely clear on exactly what output you want. If you have indeed two <https://www.mathworks.com/help/matlab/ref/string....

8 years ago | 0

| accepted

Answered
(2018a) Implicit Call to Inherited Constructor is not available when used in a package
I agree with Adam there are a lot of inconveniences that come with packages, so I've given up on them entirely. I also compl...

8 years ago | 0

| accepted

Answered
Add elements of array A to array B and ensure there is no repeated element in B?
B = unique([B, A]); %assuming B and A are row vectors. If you want to preserve the original ordering of elements: B ...

8 years ago | 0

Answered
why when i run code this error fv(:,1) = funfcn(x,varargin{:}) ?
I don't even understand why you'd try to pass your variable |w| to |fminsearch|. The whole purpose of the |fminsearch| is to min...

8 years ago | 1

| accepted

Answered
How to assign a sparse matrix of dimension n x n into a 3d sparse matrix
Matlab sparse matrices are a 2D affair only,I'm afraid. There are FEX submissions that implement 3d sparse matrices however, e.g...

8 years ago | 0

Answered
Get content of cell array when looping over it
Yes, it would be nice if matlab had something like a |foreach|. However, it does not and the only option you're left with is ...

8 years ago | 1

| accepted

Answered
MATLAB:InputParser:ArgumentFailedValidation
I don't know about matlab specifically, but it's normal for an executable to treat all command line inputs as characters. It's n...

8 years ago | 1

| accepted

Answered
Tricky Regexp Problem, How to specify a slightly varying pattern
If I understood correctly, the pattern you want to match is: * one or more uppercase character at the start: |^[A-Z]+| * fol...

8 years ago | 2

| accepted

Answered
Selecting specific time from date and time array?
Any reason you're not using <https://www.mathworks.com/help/matlab/ref/readtable.html |readtable|> to read your file. Once read ...

8 years ago | 0

Answered
I have 135987 * 69 table. I want to convert all negative values to NaN. Any Suggestions?
tablecontent = yourtable{:, :}; tablecontent(tablecontent < 0) = NaN; yourtable{:, :} = tablecontent; This assumes t...

8 years ago | 1

Answered
Append element to a cell
_Index exceeds matrix dimensions_ Well, then considering that the only indexing is of your cell array, either it doesn't have...

8 years ago | 0

Answered
How to report an identified bug in MATLAB?
<https://www.mathworks.com/support/contact_us.html> and click on |Create Service Request|. As specified you need an active so...

8 years ago | 0

Answered
How do I fix the error "Line 10: Parse error at 2: usage might be invalid MATLAB syntax"?
What is unclear about the error message? Clearly you're missing something between |2*cosd(60)| and |2*sind(60)|, perhaps an oper...

8 years ago | 0

Answered
Running On matrix by diagonals
One option: [rows, cols] = size(A); indices = (1:cols+rows)*rows - (0:rows-1)'*(rows+1); indices = indices(indices > ...

8 years ago | 0

Answered
Hi, I have a problem with dividing in Matlab. when I divide to variables m(1)/m(2) it result in integer, but it's real value is decimal. how can I get the real value?
_but its real value is decimal_ Is it now? * m(1) is 1 * -1/4 * -1/2 * -3/4 * -1 = 3/32 * m(2) is 1/4 * 1 * -1/4 * -1/2...

8 years ago | 0

| accepted

Answered
how can i get proper ans to following code.
Considering that your cell array only contains one matrix I don't see why you're bothering with a cell and all these |cellfun|. ...

8 years ago | 0

Answered
I have 2 for commands, and only one works?:O
I assume that |k = 0:100| is a mistake. For your code to work |k| can't go higher than |size(A, 1)/2*Y - 1|. It would appear ...

8 years ago | 0

| accepted

Answered
Exporting from matlab to excel with macro?
To achieve exactly what you want, you'd have to automate excel from matlab through |actxserver|. If you're familiar with excel V...

8 years ago | 0

| accepted

Answered
How do I print the code for an html link to a file?
fprintf(sometext) prints to the command window fprintf(fileid, sometext) prints to the file whose fileid you got fr...

8 years ago | 0

Answered
recursive permutation algorithm in matlab
For a start, the algorithm on the page has two input arguments. Both are essential since they change at each recursion. Note tha...

8 years ago | 0

Answered
Convert Pixel Values Back to Matrix Indices?
Hum, a binary image *is a matrix of 1s and 0s*. There is nothing to do turn one into the other. regionprops returns its outp...

8 years ago | 1

Answered
How can I run my code for each row of data in my excel spreadsheet?
Your |R_1|, |R_2| and |R_3| are vectors. Therefore |R_1 < 0.1| is a logical vectors, which you're then passing to |if|. It's alm...

8 years ago | 0

| accepted

Answered
Sorting columns in classes
A simpler option than splitapply is to use |varfun|: edges = min(T.Distance):0.05:max(T.Distance)+0.05; group = discreti...

8 years ago | 0

| accepted

Answered
check database, save wrong rows in a new table and delete them from original database
tab_night = sortrows(tab_night); %order timetable chronologically dbuid13_rows = find(tab_night.Column1streamId == 'dbuid-...

8 years ago | 0

Answered
How to iterate through cell array of doubles
The error is with the syntax of your |for| which should be: for i = 1:length(num) %and numel instead of length would be ...

8 years ago | 0

Load more