Respondida
Build a matrix of zeros with the size of the initial matrix according to indices
newM = zeros(size(M)); newM(sub2ind(size(M), repmat((1:size(idx, 1))', 1, size(idx, 2)), idx)) = val

más de 7 años hace | 0

| aceptada

Respondida
summation of each pair of columns in a matrix
Most likely, given the limited explanation: sum(permute(A, [3 2 1]) + permute(A, [2 3 1]), 3) The following may be slightly mo...

más de 7 años hace | 0

| aceptada

Respondida
Table: Add only selected collumns
1. Create the full table first, however you were going to create it: name = {'Joe'; 'Elisa'; 'John'}; age = [30; 10; 25]; wei...

más de 7 años hace | 0

| aceptada

Respondida
CellSelectionCallback-update column name
Well, yes, for what you want to do to work, you need a way to update your UI_Column dialog whenever your CellSelectionCallback i...

más de 7 años hace | 1

| aceptada

Respondida
How can I fix this error - "Matrix dimensions must agree" "x{end,1}.AppName == aa1{selA,1}.Type"
x{end,1}.AppName and aa1{selA,1}.Type are not the same size and neither of them is scalar in the non-scalar dimension of the ot...

más de 7 años hace | 0

Respondida
How can I find a specific value of member in cell array
It's really not clear from your description but it sounds like each cell of the cell array contains a scalar structure. If that'...

más de 7 años hace | 0

Respondida
Read mixed numbers in Matlab
I would recommend that you modify whatever is creating these files so that it creates files that don't have such an unusual form...

más de 7 años hace | 0

Respondida
Undefined function for input arguments of type 'double' - fit function
Most likely you don't have the curve fitting toolbox installed or you don't have a license for it.

más de 7 años hace | 3

| aceptada

Respondida
Converting 2 8 bit integers into a 16 bit?
swapbytes on an array of uint8 is never going to swap anything. If you want to change the order of the two bytes, then simply co...

más de 7 años hace | 1

| aceptada

Respondida
I have large matrix and i want to find the number of consecutive zeros if there is more than 10 disply(hole) and give the index of the start and end of this vector of zeros,
x=[1 0 1 4 8 4 3 5 9 0 0 0 0 0 0 0 0 0 0 0 0 0 4 4 0 0 0 0 2 4 4 4 4 0 0 0 0 0 0 0 0 0 3 5 6 3 0 0 0 0 4 4 4 0 0 0 0 5 4 1 0 ...

más de 7 años hace | 2

| aceptada

Respondida
how to create this matrix?
Assume your formula is and not what you have written: nrows = 5; %number of rows. You haven't specified ncols = 7; %numbe...

más de 7 años hace | 1

Respondida
How come that meta.class reports that a long list of methods are defined by a class that has nothing but a single enumeration block?
Yes, it's not very well documented. Most of these methods are simply overloads for enumeration classes. You can see that if you ...

más de 7 años hace | 0

Respondida
how to access variables from one function to another function?
The simplest is to store your feature vector in handles. % --- Executes on button press in pushbutton4. function pushbutton4_C...

más de 7 años hace | 1

| aceptada

Respondida
Data transfer from excel to matlab!
It would be much easier to help you if attached a demo excel file so we can be sure of the actual format you're using to store t...

más de 7 años hace | 0

| aceptada

Respondida
I need to pick random elements from array until a specific sum is met
Use a while loop: a = readtable('dom.txt'); %use a better variable name than a. One that has meaning. summen = NaN; %initial...

más de 7 años hace | 1

| aceptada

Respondida
Create a zero matrix and update cells based on other column values
I would do it like this: First create a function to create a matrix, given column vectors of ids, ans, and steps for a single s...

más de 7 años hace | 0

| aceptada

Respondida
Matlab not squaring imaginary part of complex number.
"The complex number is being squared and should result in a real answer with no complex part at all" Huh? Certainly not. . You'...

más de 7 años hace | 1

| aceptada

Respondida
Creating an image of first non-zero values in a 3d matrix
One way: inverted_image = ~im_datacube; max(cumsum(inverted_image, 3) .* cumprod(inverted_image, 3), [], 3)

más de 7 años hace | 0

Respondida
Why does builtin subrefs-method return only the property of one element of an object-array?
The correct syntax should be: [varargout{1:nargout}] = builtin('subsref', obj, S); See Code patterns for subsref and subsasgn

más de 7 años hace | 0

| aceptada

Respondida
R2019a release notes
Release notes for pre-releases are covered by a non-disclosure agreement. Unless you are invited to test the pre-release you can...

más de 7 años hace | 1

Respondida
How do I create two cell arrays in Matlab from two tables(based on date and time) as follows?
Both columns are datetime! That's a very bad idea. Regardless of what is displayed, a datetime always contain both date and time...

más de 7 años hace | 0

| aceptada

Respondida
Index exceeds array bounds and some other mistakes
When complaining about errors always give us the full text of the error message, everything in red, so we don't have to guess fr...

más de 7 años hace | 1

Respondida
How to make a scatter table programmatically?
There's no x value smaller than 0.5 in your inputs so it's unclear why you have a 10 in your first row of your table. I'm going ...

más de 7 años hace | 1

| aceptada

Respondida
How can I get the mouse position on an image after uploading it on axes
By default Image objects capture mouse clicks. So if an Image is displayed in an axes, when you click on it it's the ButtonDownF...

más de 7 años hace | 1

Respondida
How to add element to cell array directly in matfile?
You can't do it directly. You have to load the whole cell array, modify it and write it back as you have done. The documentation...

más de 7 años hace | 0

| aceptada

Respondida
Set and read matrix from 'setenv'
It sounds like you have a script where all the inputs are hardcoded. First, convert the script into a function with the appropri...

más de 7 años hace | 0

Respondida
Vectorization of Operation inside Matrix
First, permute DH so that the rows are in the 3rd dimension as in your output. Then you can vectorise your calculation: DH = pe...

más de 7 años hace | 1

| aceptada

Respondida
Change the name of structure inside a cell
In your screenshot, mlrModel, fsrModel, etc. are the name of classes. They may look like structures but these things are absolut...

más de 7 años hace | 0

| aceptada

Respondida
Re-arranging array columns in alternating form
function Y = AlternateColumns(X, n) Y = reshape(permute(reshape(X, size(X, 1), [], n), [1 3 2]), size(X, 1), []); end Bas...

más de 7 años hace | 1

| aceptada

Respondida
How to import and read Excel input into an executable
readtable will read an excel file and directly transform each column into variables of a table. I would not recommend having ov...

más de 7 años hace | 1

| aceptada

Cargar más