Réponse apportée
Transformation of the Matrix in a Loop
With your invented notation it's difficult to know what you actually have in matlab. Assuming you have a matrix such as: Z = [...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Old Matlab script not running on newer version
The equivalent of your wavwrite using audiowrite is: audiowrite(fullfile(subj_name, sprintf('%d.wav', block_num)), recordedaudi...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Merging matrices by comparison of values of several columns
Nearly right [~, whichArows, whichBrows] = intersect(out1(:, 2:4), out2(:, 2:4), 'rows'); C = [out2(whichBrows, 5), out1(which...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Using For Loop to get different outcomes
if ismember(psi_value, [0.05, 0.15, 0.25, 0.35]) %maybe use ismembertol s_plot = 0.8; else s_plot = 0.2; end Note ...

presque 7 ans il y a | 0

Réponse apportée
Store a group of points (given x, y, and value) into image efficiently
img = zeros(1000, 1000); img(M(:, 2) + 1000 * (M(:, 1) - 1)) = M(:, 3);

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Negative Value when using Trapz
Can someone tell me as to why this is the case Because your x vector is decreasing, so is negative for each trapeze a = trapz...

presque 7 ans il y a | 2

Réponse apportée
Create two arrays on the basis of other arrays
%first find which of A or B elements are going into. Only depends on V isA = false(size(V)); %put in A (true) or B (false) lA...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Create a random sequence based on a matrix columns
A= [1 3 2 4 5 8 9 11 14; 0 0 0 7 6 12 0 0 0; 0 0 0 0 10 13 0 0 0]; %first add an extra column of 0s if the num...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
convert nested struct to matrix
Well, you obviously can't concatenate vectors of dfferent sizes so if you want to do that you either have to trim the longer vec...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Timetable Monthly Average over Many Years
The easiest: precip = table2timetable(readtable('CR_precip.csv')); monthlyavg = groupsummary(precip, 'day', 'monthofyear', 'me...

presque 7 ans il y a | 4

| A accepté

Réponse apportée
How to extract strings from a table?
Why is the size of the array hardcoded (which means the code will break if something change with the file) instead of just askin...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Combining consecutive vectors into a matrix
You must have changed the options of the wizard to specifically create variables from the columns of the excel spreadsheet. Don'...

presque 7 ans il y a | 1

Réponse apportée
Index in position 2 exceeds array bounds (must not exceed 4).
I don't know what else you expect from your code. You purposefully create an array data with 4 columns and then write: .. = 1/...

presque 7 ans il y a | 0

Réponse apportée
how can I save the data generated from a function that depends on 3 parameters
Assuming the outputs of proprad are all scalar: [Wpig, chla, starch_content] = ndgrid(3:0.5:8, 0.6:0.2:0.5, 2:4:52); [Waveleng...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How to convert data with 3Dimensions to cell array
The simplest is: B = num2cell(A, [1, 2]); %keep rows and columns together, split the pages This will give you a 1x1x2353 cell...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Saving textfiles in a other folder
It's never a good idea to modify the matlab path (with addpath or others) just to read or write data files. The simplest way t...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
How can I merge a row from one table to a second table with more data based on name?
it's not clear what you want the new table to be, nor what you want to do afterward with it (save it?). Here's a start. Adapt as...

presque 7 ans il y a | 0

Réponse apportée
fsolve on polynominal function
Solving is the same as solving , which is easily solved with roots: roots([a, b, c-1]) your myfun doesn't make much sense: y...

presque 7 ans il y a | 0

Réponse apportée
How do I make matrix of ones and zeros alternating depending on size and elements of an array?
Here's a fairly simple way: B = zeros((numel(A)+1)/2, sum(A)); for row = 1:2:numel(A) B(ceil(row/2), :) = repelem([0, 1, ...

presque 7 ans il y a | 1

Réponse apportée
How would I 'trim-the-fat' off of individual text files that are part of a loop?
If I understood correctly: opt = detectImportOptions(yourtextfile); opt.DataLines = [1 36e6]; %only read the first 36000000 l...

presque 7 ans il y a | 0

Réponse apportée
Replacing variable names when using func2str of anonymous function
As I suggested, it's possible to do this with the undocumented mtree function: function fstr = replacevar(fstr, vars, replaceme...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
how to obtain values using a key in another table?
First, convert the date strings into proper dates. However you imported that data, you should be able to import it directly as d...

presque 7 ans il y a | 0

Réponse apportée
Use "datastore" on a .cvs file without headers (or matlab identifiers)
Use the ReadVariableNames option: ds = datastore(somelocation, 'ReadVariableNames', false)

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Infrared Thermography Image Analysis Code Error
The mouse coordinates returned by ginput are rarely integers so, indeed, you can't use them as is as image pixel coordinates. Th...

presque 7 ans il y a | 0

Réponse apportée
From .csv to .mat, matrix indexing
Not exactly sure what you're asking, is it simply? labelFaceGrid = T{:, 4:7}; %extract column 4 to 7 as a matrix

presque 7 ans il y a | 1

| A accepté

Réponse apportée
What exactly is going on with this code? I'm having difficulty understanding it
Removing all the unnecessary cruft, this is probably what the code reduces to. I've gone with the fact that your files are 400,0...

presque 7 ans il y a | 1

| A accepté

Réponse apportée
Check if I have done everything right
2) you haven't done what's asked (plot the function) 4) is wrong (hint clear f and run that again) 5) you haven't done what's ...

presque 7 ans il y a | 0

Réponse apportée
Create an array from a cell array
For just one element of the cell array, eg. G{1}: [uval, loc1, ids] = unique(G{1}(1, :)); %get unique values of first row, wi...

presque 7 ans il y a | 0

| A accepté

Réponse apportée
Does Matlab support GTX 1660 graphics card?
If you're talking about using the card for GPU computing, the actual model is not important, it's the architecture. All the card...

presque 7 ans il y a | 0

Réponse apportée
What is the problem with my code? please help me
Isn't the error message clear enough? Undefined function 'randon' ... Indeed, I'm not aware of a randon function in matlab. Ma...

presque 7 ans il y a | 0

Charger plus