Respondida
matrix dimension reshape error
i had expected to have dimension error in line 6 but it did not I would expect an error if the if condition is true when n <= 2...

más de 6 años hace | 0

Resuelto


Cell joiner
You are given a cell array of strings and a string delimiter. You need to produce one string which is composed of each string fr...

más de 6 años hace

Respondida
Best way to create a matrix of points?
A=[-5 -4.5 1.5 2; -5 -4.5 2 2.5; -5 -4.5 2.5 3; -4.5 -4 1.5 2; -4.5 -4 2 2.5; -4.5 -4 2.5 3]; points = unique([A(:, [1, 3]); ...

más de 6 años hace | 1

| aceptada

Respondida
Regarding matlab cody solutions
Once you solve a problem, you can see other solutions of the same size or larger. You won't be able to see smaller solutions unt...

más de 6 años hace | 2

Respondida
How to reshape the columns of a matrix into one row?
It's not clear what it is you want as an output. If it's a row vector, there's no concatenation involved, you just simply reshap...

más de 6 años hace | 1

| aceptada

Respondida
Hello. How much does support about license Matlab Version 9.5 (R2018b) cost for year?
Contact Mathworks sales for this. The cost is going to depend on the type of license you have, on which toolboxes you have and w...

más de 6 años hace | 1

Respondida
Speed up calculation of normal vectors metric
Why do you remove the current point from the search set. Doing that means copying the whole point matrix (bar one point) for eac...

más de 6 años hace | 0

Respondida
Copy an Excel worksheet from one workbook to another with Matlab
You may as well write a macro in excel because you'd be using the same code in matlab: excel = actxserver('Excel.Application');...

más de 6 años hace | 1

| aceptada

Respondida
How can I get filenames for individual images in a multi-page tiff stack?
Probably with: filepath = 'C:\somewhere\somefile.tiff' infos = imfinfo(filepath); %should return a Px1 structure where P is t...

más de 6 años hace | 0

Respondida
Using cellfun with function that can return nothing
I'm not going to comment on the wisdom of using evalin. The problem is not with cellfun. You'll get the same error if you do: ...

más de 6 años hace | 0

| aceptada

Respondida
Split values for a time-frame to every 15 minutes
This should work. First a function to operate on each row of your table: function spreadtable = spreadvolume(dstart, dend, vol...

más de 6 años hace | 1

| aceptada

Respondida
Indirectly addressing a tall datastore -- MATLAB Golf
Is your FIELD column imported as a string array (as opposed to cellstr)? As a cellstr the == 'BN_SURVEY...' wouldn't work, you'd...

más de 6 años hace | 0

Respondida
anyway to cat specific column using horzcat?
As others have said, no you can't do that with a single statement. Assuming a cell array of any shape and size, rik's suggestio...

más de 6 años hace | 0

Respondida
C Mex File - Pass an Int into it
All the mxGetInt**s functions requires that you use the Interleaved Complex API which you enable with the -r2018a switch to mex....

más de 6 años hace | 1

Respondida
Generating long string with 0 (probability of 0.5) and 1 (probability of 0.5) with space in between two adjacent characters
One way: num01 = 1e5; %how many 0 and 1 you want in total strjoin(string(randi([0 1], 1, num01)), " ")

más de 6 años hace | 0

Respondida
NI-Scope Documentation
The relevant documentation comes from National Instrument, not Mathworks. The driver manual should have been installed when you ...

más de 6 años hace | 0

| aceptada

Respondida
Output score which is nearest to image date
The second output table is easy: %demo data: source_table = table([4270;4999], datetime({'17/11/2011';'02/04/2014'}, 'InputFor...

más de 6 años hace | 1

| aceptada

Respondida
how to create an index that keep tracking the hours in the data
Here's how I'd do it: %twomonth: a Nx3 matrix, whose first column is hour, 2nd is price, 3rd is demand bin = discretize(mod(tw...

más de 6 años hace | 2

| aceptada

Respondida
Code is running continuously, but never ends
As others have said, you need to debug the code you've written, using the various tools that matlab offer. waitbar is one, you c...

más de 6 años hace | 0

Respondida
Replace row of matrix with vector by logical indexing
a = 101:120; %a should really be a column vector to start with, if it's meant to work along the rows of b b = reshape(1:100, 20...

más de 6 años hace | 0

Respondida
how to fread not a file, but a vector that equals fread a file in binary form?
There is not fread(fileid, 'r'), there is a fopen(filename, 'r') but that tells us nothing about how you read the file initially...

más de 6 años hace | 0

| aceptada

Respondida
recode the missing values equal to the preceding recorded value
The easiest way is to use fillmissing with the appropriate option, after having replaced the -999 by NaN.

más de 6 años hace | 0

Respondida
How to remove letters from cell arrays
Don't use the ancient datestr or datevec particularly for dates as you have that are timezoned since these don't support time zo...

casi 7 años hace | 0

Respondida
Call specific rows of a table then choose rows that has specific criteria in those rows .
I want to say for each radius celltracker_group2.time == 10 if radius<=3 and cell_type==4 then GroupCount=GroupCoutn+1 Easily d...

casi 7 años hace | 0

| aceptada

Respondida
Using for loop for arrays
Not sure what is wrong You'll always going to get min(74, numel(a)) as a count, since you're comparing the index i instead of t...

casi 7 años hace | 0

| aceptada

Respondida
Vectorizing nested for loops
I am generating hundreds to thousands of particles That's not many, it's only when you get in the order of a hundred thousand t...

casi 7 años hace | 1

Respondida
Target just the last added entries to a matrix
As commented: A(end-n:end, :) will give you the last n+1 rows of the (2D) matrix. does your solution only work with a loop W...

casi 7 años hace | 0

| aceptada

Respondida
how to generate a matrix with all possible combinations in an efficient way
For reasonable n and m you can either use Jos' allcomb or the following: %n: a vector of numbers %m: a scalar integer allcomb...

casi 7 años hace | 0

Respondida
Creating a script with if statements
In matlab, if statements should be your last resort. By necessity if statements apply to scalars so they tend to force you to us...

casi 7 años hace | 0

| aceptada

Respondida
How to calculate the average gradient of an image?
Missing from your equation, is the exact definition of G. You're currently using the sobel operator to compute the gradient and ...

casi 7 años hace | 1

Cargar más