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

mehr als 6 Jahre vor | 0

Gelöst


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

mehr als 6 Jahre vor

Beantwortet
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]); ...

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 2

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

Beantwortet
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');...

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 0

Beantwortet
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: ...

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 1

Beantwortet
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)), " ")

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

| akzeptiert

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

mehr als 6 Jahre vor | 2

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 0

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

mehr als 6 Jahre vor | 0

| akzeptiert

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

mehr als 6 Jahre vor | 1

Mehr laden