Answered
join two tables using outer or inner join
I'm unclear what difficulty you have. You seem to have already worked out which function you need. join(table1, table2, 'Le...

9 years ago | 1

| accepted

Answered
Is there a faster alternative for find() operation?
This can be done in just one line without any loop using |accumarray|: X = [1; 2; 3; 4; 1; 4]; Y = [10; 21; 4; 4; 10; ...

9 years ago | 2

| accepted

Answered
Matlab 2012 crate table
Complete guess as your question is very unclear: You're trying to write an excel file. In which case: m = str2double(get(ha...

9 years ago | 0

| accepted

Answered
Trying to speed up a circle machine
I don't have matlab on this machine to test but replacing your circle creation loop with just pkList2 = permute(pkList, [3 ...

9 years ago | 0

Answered
Capturing partial coordinates from text file...
regular expressions may not be the right tool for this job, particularly, if the order is not guaranteed to be XYZ. If it is gua...

9 years ago | 1

| accepted

Answered
What is the best way to read in a txt file that is organized with different sections from top to bottom?
|readtable| is not designed for this kind of files and will not work. With these kind of file, unfortunately, you do have to ...

9 years ago | 0

Answered
Import data from text file
use <https://uk.mathworks.com/help/matlab/ref/readtable.htm |readtable|> which should be able to figure out the format of your f...

9 years ago | 1

| accepted

Answered
Convert 3-D matrix to a table
If you want 4 columns, then your |reshape| is wrong. You probably meant: Var1 = reshape(Mat(:, 1, :), [], 4); %... If...

9 years ago | 2

| accepted

Answered
Error using digraph/subsref
Is there actually a |Weight| column in your edge table? If you haven't specified a weight of any edge, the |Weight| column is ne...

9 years ago | 0

| accepted

Answered
The problem about the display of image(Matlab2014b)
The image is not blank. It is all white. Matlab assumes that an image of type double is in the range [0-1]. 0 being black, 1 ...

9 years ago | 1

Answered
Concantenate Horizontally Matrices from Two Different Cell Arrays
You say concatenate horizontally, yet your example show vertical concatenation cellfun(@vertcat, A, B, 'UniformOutput', fal...

9 years ago | 0

| accepted

Answered
Vectorized "find an replace"
Assuming all values in |A| are valid indices for |map|, simply: A = map(A);

9 years ago | 1

Answered
What can I use instead of eval() to change the name of a variable in a Table?
You say that your data is often in the format of an Excel xlsx file. Your code as it is will never be able to read such files. I...

9 years ago | 1

Answered
how to convert numbers to days names
96*31 is 2976, not 2900. I'm not really clear on the format of your input, but in any case use the <https://www.mathworks.com...

9 years ago | 0

| accepted

Answered
How do I exclude NaN values when calculating mean of each row in a matrix?
Since version 2015a, the max, min, mean, median, sum, var, std, and cov function have included a flag to ignore nans y = me...

9 years ago | 7

Answered
How to replicate "two hash iterations (denoted SHA256^2 ie "SHA256 function squared")" in MATLAB?
|dec2bin|, |hex2dec| and co don't work the way you think they're doing. >> hex2dec(header_hex) ans = 1.782203420...

9 years ago | 2

| accepted

Answered
innerjoin error and potential matching questions
Well, the error message is clear, the ticker column in at least one of your table contain a mixture of char array and non-char a...

9 years ago | 0

| accepted

Answered
assign same name to multiple rows in table
I'm not sure what you mean by _assign same name to them_. It sounds like you haven't completely understood the concept of tables...

9 years ago | 1

Answered
random number generation to add and subtract
Another option: numbers = -1; while sum(numbers) < 0 | sum(numbers) > 9 | any(cumsum(numbers) < 0) numbers = randi...

9 years ago | 0

Answered
Trigger function with precission
Mathworks doesn't document how their timer is implemented, therefore it's impossible to tell what the actual resolution and pote...

9 years ago | 0

Answered
grouping elements from a table
Step 1: define a function in its own m file that applies the appropriate filter to each column (unfortunately, you can't use ano...

9 years ago | 1

Answered
How to extract values from for loop and put in a matrix.
Of course, each row is the same. You overwrite rows 1:1000 each step of the MC, WC, and EGC loop. As for the jj loop, what's ...

9 years ago | 0

| accepted

Answered
How to display comments in a .dat file?
Just read the first NL lines and display them %... [fid, message] = fopen(filename, 'rt'); for row = 1:NL fprin...

9 years ago | 0

| accepted

Answered
How to convert all the cell in a columns from char to string
Hum! it's not actually that easy as you can't use the syntax |yourtable(:, somecolumns)| to change the type of the column from c...

9 years ago | 1

| accepted

Answered
how to read svc file in matlab?
In essence, the error tells you that matlab failed to open the file. There can be several reasons for that, the most common bein...

9 years ago | 0

Answered
report a MATLAB problem (calling cell as {A{i}} being faster than A(I))
That is indeed strange. Note that |A(k)| makes a lot more sense than |{A{k}}|. Both create the same thing but conceptually, ...

9 years ago | 2

| accepted

Answered
Create a random Matrix with numbers in a distribution
Much simpler: pixvalue = 0 : 0.2*pi : 2*pi; phmatx = pixvalue(randi(numel(pixvalue), 256, 1))

9 years ago | 0

| accepted

Answered
Why does == not work with decimal indexed for loop?
What you're seeing is expected and is inherent to the way numbers are stored on computers. You'll see the same behaviour with ot...

9 years ago | 1

Answered
Read different files with different names (string) in a loop in MATLAB
You use curly braces |{}| to access the content of a cell array. You don't use |sprintf|, or |strjoin| or any special function. ...

9 years ago | 0

Answered
Replace values in an array with values from a single row in another array
A(sub2ind(size(A), repmat(1, size(B)), B)) %the 1 stands for row 1. is all that is needed. This will give you the value...

9 years ago | 0

| accepted

Load more