Respondida
Simple Question, Please Answer 3
Step 1: As Stephen said, get rid of the global variables. Modify that Optimasi_HS3 function so that it takes the G and U as inpu...

más de 7 años hace | 1

Respondida
COM Syntax Queston (Excel example but general puzzle)
I find it's very rare that you have to use invoke. You certainly don't need to for SaveAs or Copy. Yes, matlab does not impleme...

más de 7 años hace | 1

| aceptada

Respondida
how to write a function?
tofind = [0, 1, 1, 0, 0, 1, 0, 1]; found = A(ismember(A(:, 4:11), tofind, 'rows'), :) will return all the rows of A whose colu...

más de 7 años hace | 0

| aceptada

Respondida
islocalmax dont find the first maximum
Why Matlab cant find one of the first maximum Because matlab wants it to be truly a local maxima, that is it needs to be preced...

más de 7 años hace | 4

| aceptada

Respondida
how can I handle colors
Possibly, this will do what you want: matcontent = load('C1fig.mat'); %load ans variable (bad name!) as matcontent.ans greyim...

más de 7 años hace | 0

| aceptada

Respondida
another import from textfile question
Your file is a simple tab delimited file that is trivially read by csvread or dlmread or readtable: M = csvread('M0905_PK6.txt'...

más de 7 años hace | 0

Respondida
Error using cat AND cell2mat
The error is clear. For cell2mat to concatenate the matrices in the cell array into one matrix, the matrices must have consisten...

más de 7 años hace | 0

| aceptada

Respondida
fusion of satellite images
First, don't use image as a variable name, it's already the name of a matlab function that you may want to use. In the same vein...

más de 7 años hace | 0

| aceptada

Respondida
How to generate an nxn matrix using n number of 2x2 matrices?
"I am trying to combine 6 2x2 matrices to create a 6x6 matrix in a similar fashion" According to your algorithm the stiffness m...

más de 7 años hace | 0

| aceptada

Respondida
How do I replace cell in specific column
Now that you've explained clearly what you want: A = [0 1 1 0 1 0 0 1 1 1 1 1 1 1 ...

más de 7 años hace | 2

| aceptada

Respondida
How to speed up this code?
Your code would be much faster if you didn't so many unnecessary conversions. a.a is a comma separated list (which is bascially ...

más de 7 años hace | 1

| aceptada

Respondida
Assigned variables from app designer into base workspace, but they disappear when I run the .m file
Most likely, the code in Run.m is a function not a scripts. Probably a function that has optional inputs (or no inputs at all) i...

más de 7 años hace | 1

Respondida
Multiplications inside a cell array
result = cellfun(@times, yourcellarray(1, :), yourcellarray(4, :), 'UniformOutput', true) will create a 1x12 cell array of 33x3...

más de 7 años hace | 1

Respondida
Im struggling with why this while loop returns zeros and more or less how to get all the matricies in the while loop to be the same size. Thanks for any and all help in advance. Also M is from an excel document and has 125 values while n is 5.
The while loop is pointless. Since on each iteration it just take the next if branch, you may as well just have a linear code. ...

más de 7 años hace | 1

| aceptada

Respondida
How to get data from containers.Map and store to a new table then view the table
I'm not sure Andrea is still interested in an answer as the question is fairly old now. As Peter said, if the purpose of the con...

más de 7 años hace | 0

Respondida
MATLAB codes with a network licensing
Yes, it can be easily implemented (in matlab or any other language). It can also be trivially defeated by capturing the network ...

más de 7 años hace | 0

Respondida
ISMEMBER() modified result desired
Maybe I misunderstood the problem, but ismembertol already has the option to return all matching indices in B: [found, where] =...

más de 7 años hace | 1

Respondida
How to Sum N elements of matrix
An equation usually involve an assignment. I'm assuming the result is supposed to be assigned to I(x, y). You also haven't said ...

más de 7 años hace | 1

Respondida
How to concatenate Nx3 matrix vertically?
but it still just prints the matrix horizontally in the command window Yes. because that's exactly how you're asking matlab to ...

más de 7 años hace | 1

| aceptada

Respondida
how to connect pixels of a binary image as shown in picture?
I would try morphological closing and see if that gets the result you want, e.g. img = imread('image.png'); newimg = imclose(i...

más de 7 años hace | 1

| aceptada

Respondida
How to put each two elements in a matrix in a cell ?
Well, it's important to use proper formatting in your question. Stephan answered your original question according to the way it ...

más de 7 años hace | 2

| aceptada

Respondida
how to search about a matrix in a cell?
it's always a good idea to give the result you expect for your example to avoid ambiguity. A={ [0;0] [0;1] [1;0] [0;0] } ...

más de 7 años hace | 2

| aceptada

Respondida
How can i find the elements of an array with in tolerance and map them to a unique number if those number are within that tolerance?
This requires the image processing toolbox (for bwlabel). It also requires that A is sorted (which appears to be the case in you...

más de 7 años hace | 0

| aceptada

Respondida
Matrix Value Replacement Problem
so the E and W directions work but for some reason I can't get the N and S directions to work at all As far as I can tell the c...

más de 7 años hace | 0

| aceptada

Respondida
choose row cell of matrix
C = cellfun(@(rows) A(rows, :), B, 'UniformOutput', false) or if you prefer a loop: C = cell(size(B)); for idx = 1:numel(B) ...

más de 7 años hace | 0

Respondida
Read text file with blocks of recurring pattern
This is how I'd do it: %1. Parse the file blocks = []; %matrix to receive each block steps = []; %to s...

más de 7 años hace | 1

| aceptada

Respondida
Error using horzcat Dimensions of arrays being concatenated are not consistent.
For whatever reason,I keep on getting this annoying error There is nothing obscure about the error, and it's puzzling why you c...

más de 7 años hace | 1

| aceptada

Respondida
how to release indexes in an array
A much simpler way to obtain your r (and e): [uvals, ~, id] = unique(arr); r = accumarray(id, 1); e = find(r > 1); which als...

más de 7 años hace | 0

Respondida
How to counting frequency of a value occurence in a matrix?
Since you're passing a column vector to histc (X(:)), the output is going to be a column vector. Hence you're trying to concaten...

más de 7 años hace | 0

Respondida
comparison of the fields of two structures with a condition
If all the fields are scalar, you don't need any special function. I'm assuming that there can be at most one i and j for which ...

más de 7 años hace | 0

| aceptada

Cargar más