Answered
Reading a .dat file without a for loop
I've answered a very similar question from somebody else earlier today. Use either the second or 3rd option I suggested.

7 years ago | 0

| accepted

Answered
How to ignore the headerline
Your file format looks like something that readtable should have no problem figuring out, so try: files = dir('*.txt'); filesd...

7 years ago | 0

Answered
Reading sequence of binary packets consisting of multiple datatypes from binary file
Use fread for binary data. Following your description, probably: fid = fopen(filepath, 'r', 'l', 'ISO-8859-1'); %l for Little-...

7 years ago | 0

| accepted

Answered
hey. the problem statement is find lychrel numkbers upto 10000.i have done the coding accordingly but it is showing random characters in output..plz help guys
I suggest that you use the debugger to execute your code one line at a time and observe how it behaves and how the variables cha...

7 years ago | 2

| accepted

Answered
Error Message: expression or statement is incorrect
We're missing the most important part of your code, the function func that you pass to lsqcurvefit. Thankfully, it's in the erro...

7 years ago | 0

| accepted

Answered
Convert matrices to .csv from a double matrix and header cell
The way you construct your header is way overcomplicated: textHeader = strjoin(header, ','); fid = fopen('result.csv', 'w'); ...

7 years ago | 0

| accepted

Answered
How to simulate bit stuffing on a 20860×1 matrix of binary data?
An easy way: %demo array that will fail with most naive algorithms: v = [ones(1, 8), 0, ones(1, 5), 0, ones(1, 20)] newv = re...

7 years ago | 0

| accepted

Answered
How to get environment password in script/function
If you are talking about the password that was used by the user to log into their Windows/Mac/Linux/Whatever account, then absol...

7 years ago | 0

Answered
is the latest matlab version available for windwos (32 bit Version).
2015b was the last release to support 32-bit. See https://www.mathworks.com/support/sysreq/previous_releases.html to see the det...

7 years ago | 2

Answered
Matrix dimensions must agree error
What are these lines supposed to do? xt=xp-2<=xt<=xp+2 yt=yp-5<=yt<=yp+5 Whatever you meant for these, I'm fairly certain it'...

7 years ago | 0

Answered
How to Index Substructure
I'd recommend you use numel instead of length, it's safer. Structure indexing uses () not {} (that's to acces cell arrays and t...

7 years ago | 0

Answered
How to convert text to time and merge two seperate date and time columns in readtable
Assuming you're using R2018a or later, the 1st column will be read as a datetime array and the 2nd one as a duration array. In w...

7 years ago | 0

Answered
how to plot graph without intersection?
First, why is it a problem that some of the edges intersect in the plot? The plot is not ambiguous in any way, even if there are...

7 years ago | 0

Answered
Hi! When I try to link Matlab with hysys, error message occurs:
The error message is a bit misleading. The ProgID is indeed valid (at least for my version of Aspen Hysys). However. the error y...

7 years ago | 0

Answered
columns data to reference rows data
It really doesn't help if you invent your own syntax for your examples instead of using valid matlab syntax. It also doesn't hel...

7 years ago | 1

| accepted

Answered
convert rgb image to mean power spectral density
For that you would first need to know the frequency response of the camera sensor that has been used to acquire that photo. I ca...

7 years ago | 0

| accepted

Answered
Read a time column in a csv (convert 'char' to date) with readtable
The problem is nothing to do with the syntax of your call (which is correct, but probably you don't even need the Format option)...

7 years ago | 1

| accepted

Answered
JSON decode - lost information
It's something I've complained about to Mathworks in the early days of jsondecode. In fact, you can use matlab jsonencode to enc...

7 years ago | 3

| accepted

Answered
How to read just a part of a binary file with a predefined end position or a predefined amount of Bytes?
I'm not entirely sure I completely understand, maybe that's what you want: recordstart = ??? %some integer value. Index of firs...

7 years ago | 1

| accepted

Answered
Output argument is not assigned on some execution paths.
Well, yes the error message is correct. If TTRAJECTORY(aux,1) is greater or equal to goal(aux,1)-0.03, the only thing your code ...

7 years ago | 1

| accepted

Answered
How to calculate distance between 3D points ?
Assuming you're on R2016b or later, distance = sqrt(sum((permute(pts1, [1 3 2]) - permute(pts2, [3 1 2])) .^ 2, 3)) Rows of d...

7 years ago | 1

| accepted

Answered
Matlab write string on new line
fprintf(fileID, ['%s,' ... ID '%s,' ... frame '%s,' ... '%s\n'], ... ...

7 years ago | 1

Answered
Array exceeds memory size (9GB), although it is smaller than other arrays that work well?!
If you pass two 1x35124 vectors as indices, you will indeed get a 35124x35124 matrix back, which is the intersections of the 351...

7 years ago | 0

Answered
How to sum pixels from each sliding window in a picture?
There are many ways you can apply the sliding window. For contiguous, non-overlapping blocks you can use blockproc. If the block...

7 years ago | 1

Answered
subtraction on the cells elements
Note that [1 2 5 6 7 7 8 ] in your example is a row vector, not a column vector as you state. If the content of the cells ...

7 years ago | 0

| accepted

Answered
How to convert 182*1 struct with 20 fields to 1*1 struct with 20 fields?
"This one is very close to what I need. In final answer I need 182*1 double instead of 1*182 double" Well that's trivially fixe...

7 years ago | 0

Answered
What is the fastest way to add a row at the bottom of a table?
"Or I have to accept that working with the tables is time consuming?" You have to accept that growing anything (tables, matrice...

7 years ago | 1

Answered
How can I access the elements of one array with another array?
I'm going to assume that [ix, iy] is a 2D array, not a vector as in your example, otherwise your problem is trivially solved wit...

7 years ago | 0

Answered
Storing matrices in memory
Storing 4 matrices takes slightly more space than 1. For each matrix, you not only need to store the elements, but also some met...

7 years ago | 1

Answered
I dont understand how to store the values in an array
Your first unsure is correct. Your second one as well as long as you finish that line with something that makes sense.

7 years ago | 0

Load more