Answered
Plot data from two columns in csv
data = csvread ('eegID.csv',1); col1 = data(:, 1); col2 = data(:, 2); plot(col1, col2) csvread cannot read non-numeric chara...

7 years ago | 0

Answered
Write cell array with multiple elements in the cell to Excel File
xlswrite is not going to write multiple contents of a single cell because an Excel cell can only contain one piece of informatio...

7 years ago | 0

Answered
How do i tell the player they already guessed a number?
I would suggest keeping an array of the guessed values, and then checking if the number exists in that array. % Outside the loo...

7 years ago | 0

Answered
Moving sum in a timetable
I'm a little bit confused what you're asking for, but here is a first attempt. As I understand you are looking for each row to h...

7 years ago | 1

| accepted

Answered
Change the time format ?
I'm assuming that you have an array of doubles. This works fine for the inputs, but will not be possible with the outputs. I am ...

7 years ago | 1

| accepted

Answered
How to change precision in plot?
The values aren't actually rounding up, that's a matter of display precision. This is a guide that should help you customize it....

7 years ago | 0

Answered
how to store all values of a matrix variable during the loop
You need to add indexes to your outputs. Typically, it is usually appropriate to use your loop index value as the index, however...

7 years ago | 0

| accepted

Answered
Import CSV file using readtable gives wrong date time format.
In 'newer' versions of Matlab (sorry, I don't know when this started) it is possible to define a datetime format as a named card...

7 years ago | 0

Answered
Plotting multiple inputs on a single figure
I you are looking for separate plots like that I would suggest using subplot. This will allow you to present multiple plots in o...

7 years ago | 0

Answered
Read every nth line of text file with different deliminters across a single line
You might have an easier time using textscan instead of fgets or dlmread. You have to specify your format for a row, but that sh...

7 years ago | 1

| accepted

Answered
how to select from identical rows based on their associated value in one column?
There might be some fancy function I don't know, but it's certainly possible to do this with a loop. I cannot comment on the spe...

7 years ago | 1

Answered
Code that makes matlab jumping loops without fininishing the remaining iterations.
I'm not entirely sure I understand what you're asking for, but it seems like you want to run all iterations of the d loop with t...

7 years ago | 0

Answered
Could you please correct my program for single variable but different size and many outputs.
You are losing the different values of A because you are overwriting the value each time you run a new calculation. The way to p...

7 years ago | 0

Answered
Guess my favourite colour!
You are going to have several problems with doing any kind of comparison of the color answers to make them relate to numbers. Th...

7 years ago | 0

Answered
How to extract specific text (eg. serial number) from single/multiple text file
It is possible to use find or strcmp, but I think your best bet for this is to use regexp. If the serial number is in a consiste...

7 years ago | 0

Answered
Writing a script to take a text file and display the second word in each even numbered row
One of the simplest ways to do this is by looping through each line with fgetl, and splitting the appropriate lines with regexp....

7 years ago | 0

Answered
Program that can take three lines input by the user running the code, and saves those lines of text in a text file
There are a couple of different ways of doing this, mostly based on how much you trust the user to put things in correctly. The...

7 years ago | 0

Answered
Excel (.csv) error: "Excel Worksheet could not be activated.""
A .csv file is not actually an excel format, although it can be opened with excel. I would suggest using csvread() instead, as i...

7 years ago | 0

Answered
Naming new sets of data in for loop and dividing matrixes.
Why not just load the data into a third dimension from the beginning? for p = -10:10 filename = strcat('mea...

7 years ago | 0

| accepted

Answered
Hello everyone, help for consolidation of numbers
One convoluted way of doing this would be to convert to strings and back. for i = 1:length(A)/3 B(i) = str2num([num2str(A(...

7 years ago | 0

| accepted

Answered
string to text file
Take a look here for ways to write data in variables to text files.

7 years ago | 0

Answered
create table that count the composition of two categories.
Loading things with one command is generally always preferred, so yes, combining them into a 562x2 array is helpful. As for the...

7 years ago | 1

Answered
Extracting two-dimensional data matrix from .csv into individual variables
I'm not sure I entirely understand what you're trying to accomplish so I'm going to break things down. Feel free to let me know ...

7 years ago | 0

Answered
how to delete rows from a struct array?
vars = vars([vars.class] == 'double'); This may not work exactly (I think you might need to use strcmp instead of ==, but it sh...

7 years ago | 0

Answered
How do I create an excel file from a cell array that actually displays all the information in each colum?
I would suggest reformatting your data first, so that you have everything in the upper level of cells. for i = 1:size(result) ...

7 years ago | 0

Answered
How to edit text file in matlab?
I don't know that it is worth the effort to actually edit a text file with MATLAB, but it is certainly possible to read it, edit...

7 years ago | 0

| accepted

Answered
How to replace array values that meet condition?
I'm assuming B_1 should be the same size as B? Does order matter? If order doesn't matter: A = [3 4 5]; B = [4 6 3]; B...

7 years ago | 0

Answered
How to run completely a loop inside one other?
I suspect that the issue is not that the code actually stops, but that the results are only recorded for one internal loop. If y...

7 years ago | 0

| accepted

Answered
Adding an outer for loop for a plot
eta = [5.4 6.7 5.2]; hold on for i = 1:length(eta); eta_c = 0.6; rpf = eta(i)/eta_c; count = 0; for x = 1:...

7 years ago | 1

| accepted

Answered
Error in my "for" loop?
Currently your 'first' loop only loops through one set of indices, but you want it to loop through all c, s, and t values indivi...

7 years ago | 1

| accepted

Load more