Respondida
How to do an array conversion into a different size of array
Even simpler, no loop needed: starts = [34, 44, 54, 64]; span = 4; WD = zeros(1, 100); WD(starts + (0:span-1)') = W(1:nume...

más de 7 años hace | 2

| aceptada

Respondida
find element inside cell
Oh! That's easy then. First, there's no need for index_base to be a cell array. It uses 15 times more memory than a simple vect...

más de 7 años hace | 0

| aceptada

Respondida
What is causing dimension 1 to vary?
There are many issue with your code, some minors, some majors. 1) minor if isempty(target) == 1 should be simply if isem...

más de 7 años hace | 2

Respondida
How do I count the number of data points on a scatter plot within a cell of given dimensions?
Sound like you simply want histcounts2. According to your description, maybe: count = histcounts2(x, y, 'BinWidth', [0.05, 0.05...

más de 7 años hace | 1

Respondida
Is there another way to use mat2cell more efficiently when facing large matrices?
If so then I need to type 1474560 / 64 = 23040 times of N in the equation. Of course not! And you never had to type N more than...

más de 7 años hace | 1

Respondida
Looping through a matrix of unknown dimensions
I can see two ways of solving your problem. The first way, would be to permute the dimensions, so that your : is move to the f...

más de 7 años hace | 1

Respondida
cell2mat in a for loop
As I explained in point 2) of my comment, in the code you've posted, the ii loop does nothing useful and only the last step affe...

más de 7 años hace | 0

Respondida
Cell contents reference from a non-cell array object from a txt file
I would suspect that it is a text file and that your code was meant to use textscan instead of fread. textscan would return a ce...

más de 7 años hace | 0

Respondida
Is it possible to assign the constant value of a function handle to a variable?
You don't need to use feval to invoke a function handle with no inputs, just use some empty brackets to make it clear you want t...

más de 7 años hace | 3

Respondida
Write a function called max_sum that takes v, a row vector of numbers, and n, a positive integer as inputs. The function needs to find the n consecutive elements of v whose sum is the largest possible.
Don't use the question title to post the content of your assignment as that get truncated. Assuming that your assigment is to f...

más de 7 años hace | 5

| aceptada

Respondida
splitapply cumsum with non-scalar result
The error message tells you exactly what to do: splitapply(@(x){cumsum(x)}, inputData, G) This will output a cell array, ...

más de 7 años hace | 0

| aceptada

Respondida
Expressing an even number in powers of 2 and a multiple of an odd number.
Can't you just use a loop? function [exponent, multiplicand] = decompose(number) validateattributes(number, {'numeric'}, ...

más de 7 años hace | 0

| aceptada

Respondida
code is too difficult to understand
I'm not sure what you're looking for here. We're not going to teach you matlab, so perhaps you should grab a book and/or read so...

más de 7 años hace | 0

Respondida
Extract array information from date and create cell
dates = datetime(datestr(dates)); %... datenumber = datenum(dates); The trip through datestr is unnecessary. And converting a...

más de 7 años hace | 0

Respondida
merging 8 bit planes into single plane by combining the values of each bit into 8-bit value for each pixel
No, imfuse will not work. imfuse has no concept of bits. Your question is actually very puzzling. You already know how to combi...

más de 7 años hace | 0

| aceptada

Respondida
Reading uint16 image and converting to uint8 problem
As far as I can tell, there is nothing wrong with the way matlab decodes your image. It genuinely have very little contrast with...

más de 7 años hace | 0

| aceptada

Respondida
How do I make a function accept a vector as an input
If you want to pass the first, second, third, or nth element of the input vector to your function, then tell matlab you want the...

más de 7 años hace | 2

| aceptada

Respondida
How to get the intersecting coordinates of a binary image?
You would use the 'branchpoints' operation of bwmorph to isolate the intersections, after you've skeletonised the image with the...

más de 7 años hace | 0

| aceptada

Respondida
how to optimise the code with cell?
Why are you using cell arrays in the first place? It's just slower and has more overhead than matrices. You can just create your...

más de 7 años hace | 0

| aceptada

Respondida
How to segment a paragraph into lines and words?
Of course it's possible to segment the file. It's fairly trivial as well. Just close the image (if you're working with white tex...

más de 7 años hace | 0

| aceptada

Respondida
Is is necessary to use set/get functions?
It's not been required since R2014b, where all graphics handles became proper objects. Now, it is just an alternative way of set...

más de 7 años hace | 0

| aceptada

Respondida
Error for C(i,:)
As per my comment to your question, clearly your code is full of bugs. To find out how your code actually behaves as opposed to ...

más de 7 años hace | 0

Respondida
Dicomwrite, how to overcome limits of 32-bit?
As far as I know, the 2^32-1 limit is intrinsic to the DICOM format. The length in bytes of all objects is always encoded as a ...

más de 7 años hace | 0

| aceptada

Respondida
Categorising coordinates into a table
Is there any reason to store your data as a cell array instead of a 3D matrix (or two 2D matrices) which would make your life si...

más de 7 años hace | 1

| aceptada

Respondida
How to fill a 1024 point array with two cycles of a cosine wave?
Knowing that the cycle length of a cosine wave is , what is the length of two cycles? Once you know that, use linspace to gener...

más de 7 años hace | 0

Respondida
How do I extract numbers from mixed data to create a table?
Your log1.txt file is encoded in UTF8 and starts with a BOM (a bit unusual). Reading as text without telling matlab it's utf8 ma...

más de 7 años hace | 0

Respondida
Rearranging rows side by side based on a column value
I'm assuming that status 1 only happens once per ID. I'm also assuming that all rows of an ID are together. t = readtable('Inpu...

más de 7 años hace | 0

| aceptada

Respondida
Combine Vectors Into Matrix - NOT ALL Possible Combinations from baseline
allpoints = {[1 2 3 4], [7 8 9], [10 11 12 13], [14 15 16]}; %can be as many vectors of any length baseline = [1 7 10 14]; ass...

más de 7 años hace | 1

| aceptada

Respondida
Get Blob from Firebird SQL Database
So, what you're getting back is a java object of type org.firebirdsql.jdbc.FBBlob. You can use the methods of that object to get...

más de 7 años hace | 0

| aceptada

Respondida
How to put each group of cells in the same row ?
reshape(A, 16, [])' reshapes your cell array in columns of 16 rows (since matlab is column major). Then transpose to have rows ...

más de 7 años hace | 1

| aceptada

Cargar más