Réponse apportée
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...

presque 7 ans il y a | 0

A résolu


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

presque 7 ans il y a

Réponse apportée
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]); ...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 2

Réponse apportée
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...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 1

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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');...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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: ...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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....

presque 7 ans il y a | 1

Réponse apportée
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)), " ")

presque 7 ans il y a | 0

Réponse apportée
NI-Scope Documentation
The relevant documentation comes from National Instrument, not Mathworks. The driver manual should have been installed when you ...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 2

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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.

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 1

Réponse apportée
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...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 7 ans il y a | 0

Réponse apportée
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...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
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 ...

presque 7 ans il y a | 1

Charger plus