Answered
Reading Specific Data Into MATLAB from an Excel File
One way: opts = detectImportOptions('Static_pose.xlsx'); %should automatically figure out what part of the excel file is a tab...

7 years ago | 0

Answered
Intersection of two matrices based on 1st column
[~, rowstokeep] = setdiff(B(:, 1), A(:, 1)); %get index of rows in B whose 1st column is not in 1st column of A C = B(rowstoke...

7 years ago | 0

| accepted

Answered
Warning while opening matlab R2018b
The most important part of the error is probably: Warning: Function assert has the same name as a MATLAB builtin. We suggest yo...

7 years ago | 1

| accepted

Answered
How to efficiently replace NAN with Numirical value a reference vector
Certainly, the inner for loop is unnecessary (and the find, use logical indexing). Refr=[1 20 1 4 5 2]; WithNan=[1 NaN 1 3 2 ...

7 years ago | 3

Answered
To change 12x12 matrix to 6X12
No need for a loop: m = randi([0 100], 12) %demo matrix newm = permute(sum(reshape(m.', size(m, 2), 2, []), 2), [3 1 2]) B...

7 years ago | 1

Answered
Removing zeros in excel
No loop, no cellfun: filetoedit = 'C:\somewhere\somefile.xlsx'; [data, ~, ascell] = xlsread(filetoedit); ascell(~conv2(data...

7 years ago | 1

| accepted

Answered
undefined function or variable matlab even the variable excite
A will only exist if both n and m are greater than 2. So if matlab tells you that A does not exist we can safely assume that eit...

7 years ago | 0

Answered
number of special array in a table
It doesn't look like you have a table. It looks like a plain vector. Anyway, lengthofruns = diff([1; find(isnan(yourvector)); ...

7 years ago | 1

| accepted

Answered
what happens to Matlab when I lose connection to my network drive data all of a sudden?
As YT said, fixing the problem may be a more efficient use of your time than trying to work around it. Assuming you have enough ...

7 years ago | 2

Answered
Index in position 1 is invalid. Array indices must be positive integers or logical values.
When you give an error always give us the full text of the error message so we don't have to guess which line is causing the err...

7 years ago | 0

| accepted

Answered
i have a matrix A of size 523418*2, i want to delete repeating pair?? as i explained below. any help??
[~, tokeep] = unique(sort(a, 2), 'rows', 'stable'); %stable optional if you don't care about the ROW ordering result = a(tokee...

7 years ago | 2

| accepted

Answered
for loop with 3 variables
I would recommend that you avoid using more characters than you need to. Xvirtual = 250:10:300; %no point in the [] length(xq...

7 years ago | 1

| accepted

Answered
How can I prevent an infinite recursion within my program?
How can I prevent an infinite recursion within my program? Completely rethink your function HionpH. I have no idea what that fu...

7 years ago | 0

Answered
How can I create a moving average filter for two columns of arrays?
As said, use movmean, your particular equation is simply y = movmean(x, M) possibly with a different 'Endpoints' method than t...

7 years ago | 1

Answered
fints toweekly vs timetable retime
I'm afraid that retime is not a suitable replacement for what you did and I doubt it will ever be. However, I also don't think ...

7 years ago | 0

Answered
How can I read a large Excel sheet with low runtime?
First, why is it such a worry? Are you reading that spreadsheet in a loop? If so, why? Does it change each time? If not, why doe...

7 years ago | 1

Answered
Variable number of input matrices in a function
N = 4; A_1 = sparse(1:N,1:N,-1*ones(N,1),N,N+1); A_2 = sparse(1:N,2:N+1,1*ones(N,1),N,N+1); A = A_1+A_2; blkdiaginputs =...

7 years ago | 0

| accepted

Answered
How to start different LabVIEW version with actxserver
I don't have labview 2016 installed so can't check but it's probably going to be: actxserver('LabVIEW.Application.7') If not, ...

7 years ago | 0

Answered
How can I merge vector elements into a single number of type double?
k = polyval(v, 10) is probably the easiest. This assume of course that each element of v is an integer in the range [0-9].

7 years ago | 4

| accepted

Answered
I'm trying to compare data from excel sheet with data obtained and extracted in matlab
How can i do that using xmlread and xmlwrite? Why do you think that xlmread or xmlwrite are relevant here? Your data is not xml...

7 years ago | 1

| accepted

Answered
Why do I get an error message "Function value at starting guess must be finite and real." when my starting guess is 8?
Well, as said, global variables makes it difficult to debug. I'm certainly not going to bother trying to figure what are the val...

7 years ago | 1

| accepted

Answered
hourly average for the monthly data
Unless you're using a very outdated version of matlab, there's a much easier way to do everything you've done t = readtable('ja...

7 years ago | 0

Answered
Distribute matrix elements to smaller grids.
Easily: M = [10 20; 30 40]; scaling = 2; repelem(M/scaling^2, scaling, scaling)

7 years ago | 0

| accepted

Answered
How to solve Reference to non-existent field 'a '. Error
It's nteresting that you get a 'non existent field' error. Newer versions of matlab throw an 'invalid field name' error instead ...

7 years ago | 1

| accepted

Answered
'Value' must be a double scalar error?
Trying things at random (such as str2ouble) is not a good way to solve problems. The error message is clear, Value must be a sca...

7 years ago | 0

| accepted

Answered
swap values of an array
Trivially done: O = [11 12 13 21 14 22 23 31 25 24 32 33 34]; v = [5 10]; O([v;v+1]) = ...

7 years ago | 4

Answered
how to use function and ode45
i got a complex numbers! [...] .the question is why!? You're taking the root of a negative number , Or you're calculating the ...

7 years ago | 2

| accepted

Answered
How can I multiply all the elements extracted from an excel file with a particular value?
1) Rather than single letter variable names, use complete words that explain what the variable contain. That will make your code...

7 years ago | 1

| accepted

Answered
Problem when using retime
You can't use retime for that. retime is designed to work with timetables that can have more than one variable. In this case, it...

7 years ago | 0

| accepted

Answered
Finding the set of unique values for another set of unique values
i am looking for an array type [...] can it be filled with NaN or zeros? NaN is probably wiser. M = [ 1,3;1,3;1,4;2,5;2,4;3,1;...

7 years ago | 1

| accepted

Load more