Answered
How to disable termination character while setting up serial object?
The matlab documentation provides all property values except that on how to disable the termination character. How about the 'T...

6 years ago | 0

| accepted

Answered
while loop matrix problem
@galgool, before calling someone wrong please learn the language properly, in particular how if works when given a vector as an ...

6 years ago | 0

| accepted

Answered
write table to .xls document with variable (cell array) not splitting into different cells
You can convert your elements column into text with: A.elements = cellfun(@num2str, A.elements, 'UniformOutput', false); If yo...

6 years ago | 0

| accepted

Answered
Is there a program that allows a user to run a matlab script outside the software?
Mathworks offer a number of toolboxes that allows you to convert matlab code into something standalone, see Matlab coder and pro...

6 years ago | 2

Answered
How to sort a table within groups
I don't think you can use varfun for this. This is how I'd do it: group = findgroups(yourtable.Date); ordering = cell2mat(spli...

6 years ago | 0

Answered
how to change white background to black and black foreground to white?
The logical not operator is ~ (or you can use not): invertedI = ~BW %or invertedI = not(BW)

6 years ago | 0

| accepted

Answered
how to get the only variable in file .mat autoumaticly
Your function signature is incomplete. Hopefully, you do know how to write a function properly. function FAmax = somename(vecto...

6 years ago | 0

| accepted

Answered
creating complex MATLAB struct in C++ without using MATLAB Engine
The documentation of the mat-file format 5 is publicly available, so you can use that to construct your mat file. Unfortunately...

6 years ago | 0

Answered
How can I count specific value in one column but based on another four columns
Assuming that your dara is in a table (it would be useful if the example used valid matlab syntax): result = groupsummary(yourt...

6 years ago | 2

Answered
Creating combination matrix of all combinations
Use ndgrid and expansion of cell arrays into comma-separated lists : function c = cartprod(varargin) %c = allcomb(v1, v2, ...

6 years ago | 1

| accepted

Answered
Delete empty field - rows in a structure
As commented, you may want to use a table instead of a structure. tables are a lot easier to use: t_track20 = struct2table(trac...

6 years ago | 2

Answered
How do I get every combo of a two vectors to put into an equation?
It's really not clear what your if statements are meant to do since you wrote some calculations that are not assigned to anythin...

6 years ago | 0

Answered
How to convert 24-bit signed hex from .csv file to an array of decimal data?
I agree with Jan that sscanf is nicer and for that reason: dataTable = readtable('demo.csv'); dataDec = rowfun(@(s) sscanf(s, ...

6 years ago | 2

Answered
Select and remove/replace values in matrix
One way: nelems = 2; %number of elements to keep X = (cumsum(Y>0, 2, 'reverse') < nelems+1) .* Y

6 years ago | 2

| accepted

Answered
Importing csv file with scientific notation
Unfortunately, none of the high-level functions work with UTF16, so you have to go low-level. Even then, you'll get a warning th...

6 years ago | 1

| accepted

Answered
Writing to Excel sheet from Excel Add-In function
Note that there's no need to go through get, you can simply your code to: xl = actxGetRunningServer('Excel.Application'); xlsh...

6 years ago | 0

Answered
Create dataset from multiple Cell arrays
For lack of answers to my questions, here is a more efficient method than the accepted answer: allpatients = vertcat(Results{:}...

6 years ago | 2

| accepted

Answered
Excluding Constants from Consecutive numbers
[~, rows] = unique(D(:, 2), 'stable'); newD = D(rows, :)

6 years ago | 0

| accepted

Answered
How to parse text data
Are you still on very old version (please fill the release field next to the question)?. If on a modern version, the file can ea...

6 years ago | 0

| accepted

Answered
Why fwrite is ~320x slower in the second interation and onwards when writing interleaved data?
I would suspect the reason for the much slower writes in iteration 2 and onward is that for the first iteration, since the file ...

6 years ago | 1

| accepted

Answered
Organising data from a matrix
selectedvalue = 4; filteredmatrix = yourmatrix(yourmatrix(:, 1) == selectedvalue, :)

6 years ago | 0

| accepted

Answered
how can I read a file with the format '.cine'?
If you are talking about the video format produced by VisionResearch Phantom cameras, then they can provide you with some matlab...

6 years ago | 0

Answered
Isolating and running a piece of code separately from the rest
A complete guess, if you want to split A into groups that start when B is 0 and apply unwrap to each group: group = cumsum(B ==...

6 years ago | 0

| accepted

Answered
How can I make a vector divide 1 by increasing numbers?
v = 1 ./ (1:10)

6 years ago | 1

| accepted

Answered
convert numbers that contain the scientific notation e to the long format then round it to the fourth decimal?
I assume that what you mean is that you'd like matlab to display numbers as -0.0003 instead of 3e-4. If so, format shortg will...

6 years ago | 0

Answered
How to find array elements that meet a condition defined by an index vector?
It's not clear to me why L is a matrix of integers when the only value you care about is 5. Shouldn't it be a binary matrix? We...

6 years ago | 0

| accepted

Answered
Cannot read data from a table to create a graph
The problem is that your timestamp column is text and matlab does not know how to use text as a plot variable. I assume that th...

6 years ago | 0

| accepted

Answered
how to preallocate a variables
Again, with the code you show, there's nothing that can be preallocated. But your loops are also not very useful since the overw...

6 years ago | 0

| accepted

Answered
Matlab doesnt recognize file in path while using readObj
sarl = readobj(something) Pass the content of the variable called something to the function readobj. If readobj expects a filen...

6 years ago | 1

Answered
64 bit binary number representation in matlab without rounding off
If matlab shows the number is 1.01010101010101e+41 then you do not have a binary number. You have a decimal integer number consi...

6 years ago | 2

| accepted

Load more