Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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 ...

más de 7 años hace | 3

Respondida
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...

más de 7 años hace | 1

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

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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)); ...

más de 7 años hace | 1

| aceptada

Respondida
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 ...

más de 7 años hace | 2

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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...

más de 7 años hace | 2

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

Respondida
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 ...

más de 7 años hace | 0

Respondida
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...

más de 7 años hace | 1

Respondida
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 =...

más de 7 años hace | 0

| aceptada

Respondida
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, ...

más de 7 años hace | 0

Respondida
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].

más de 7 años hace | 4

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

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

más de 7 años hace | 0

| aceptada

Respondida
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 ...

más de 7 años hace | 1

| aceptada

Respondida
'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...

más de 7 años hace | 0

| aceptada

Respondida
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]) = ...

más de 7 años hace | 4

Respondida
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 ...

más de 7 años hace | 2

| aceptada

Respondida
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...

más de 7 años hace | 1

| aceptada

Respondida
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...

más de 7 años hace | 0

| aceptada

Respondida
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;...

más de 7 años hace | 1

| aceptada

Cargar más