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

7 years ago | 1

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

7 years ago | 1

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 4

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 2

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 1

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

7 years ago | 1

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 1

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

7 years ago | 1

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

7 years ago | 1

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 2

| accepted

Answered
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] } ...

7 years ago | 2

| accepted

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

7 years ago | 0

| accepted

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

7 years ago | 0

| accepted

Answered
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) ...

7 years ago | 0

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

7 years ago | 1

| accepted

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

7 years ago | 1

| accepted

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

7 years ago | 0

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

7 years ago | 0

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

7 years ago | 0

| accepted

Load more